Package org.drools

Examples of org.drools.WorkingMemory.startProcess()


        workingMemory.insert(jane);
       
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("name", john.getName());
        ProcessInstance processInstance1 = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
       
        params = new HashMap<String, Object>();
        params.put("name", jane.getName());
        ProcessInstance processInstance2 = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
View Full Code Here


            workingMemory.startProcess("org.drools.process-split", params);
       
        params = new HashMap<String, Object>();
        params.put("name", jane.getName());
        ProcessInstance processInstance2 = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
       
        params = new HashMap<String, Object>();
        params.put("name", julie.getName());
        ProcessInstance processInstance3 = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
View Full Code Here

            workingMemory.startProcess("org.drools.process-split", params);
       
        params = new HashMap<String, Object>();
        params.put("name", julie.getName());
        ProcessInstance processInstance3 = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
       
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance1.getState());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance2.getState());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance3.getState());
        assertEquals(2, list.size());
View Full Code Here

        workingMemory.setGlobal("list", list);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("name", "John Doe");
        ProcessInstance processInstance = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
       
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals(1, list.size());
    }
   
View Full Code Here

        workingMemory.setGlobal("list", list);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("name", "John Doe");
        ProcessInstance processInstance = ( ProcessInstance )
            workingMemory.startProcess("org.drools.process-split", params);
       
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals(1, list.size());
    }
View Full Code Here

   public void execute(ExecutionContext executionContext) throws Exception
   {
      WorkingMemory workingMemory = getWorkingMemory(workingMemoryName, assertObjects, retractObjects, executionContext);
      if(startProcessId != null && startProcessId.trim().length() > 0 )
      {
         workingMemory.startProcess(startProcessId);
      }
      workingMemory.fireAllRules();
   }
  
}
View Full Code Here

   {
      WorkingMemory workingMemory = getWorkingMemory(workingMemoryName, assertObjects, retractObjects, executionContext);
      workingMemory.setGlobal( "decision", new Decision() );
      if(startProcessId != null && startProcessId.trim().length() > 0 )
      {
         workingMemory.startProcess(startProcessId);
      }
      workingMemory.fireAllRules();
      return ( (Decision) workingMemory.getGlobal("decision") ).getOutcome();
   }
  
View Full Code Here

   {
      WorkingMemory workingMemory = getWorkingMemory(workingMemoryName, assertObjects, retractObjects, executionContext);
      workingMemory.setGlobal( "assignable", assignable );
      if(startProcessId != null && startProcessId.trim().length() > 0 )
      {
         workingMemory.startProcess(startProcessId);
      }
      workingMemory.fireAllRules();
   }
  
}
View Full Code Here

        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
       
        ProcessInstance processInstance = ( ProcessInstance )
            workingMemory.startProcess("org.drools.milestone");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        workingMemory.insert(new Person("Jane Doe", 20));
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        workingMemory.insert(new Person("John Doe", 50));
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
View Full Code Here

        Person jane = new Person("Jane Doe", 20);
       
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("name", john.getName());
        ProcessInstance processInstanceJohn = ( ProcessInstance )
            workingMemory.startProcess("org.drools.milestone", params);
        workingMemory.insert(processInstanceJohn);
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstanceJohn.getState());

        params = new HashMap<String, Object>();
        params.put("name", jane.getName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.