Search in sources :

Example 1 with Address

use of org.jbpm.bpmn2.objects.Address in project jbpm by kiegroup.

the class ActivityTest method testMultipleBusinessRuleTaskWithDataInputsWithPersistence.

@Test
public void testMultipleBusinessRuleTaskWithDataInputsWithPersistence() throws Exception {
    KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-MultipleRuleTasksWithDataInput.bpmn2", "BPMN2-MultipleRuleTasks.drl");
    ksession = createKnowledgeSession(kbase);
    ksession.addEventListener(new TriggerRulesEventListener(ksession));
    List<String> listPerson = new ArrayList<String>();
    List<String> listAddress = new ArrayList<String>();
    ksession.setGlobal("listPerson", listPerson);
    ksession.setGlobal("listAddress", listAddress);
    Person person = new Person();
    person.setName("john");
    Address address = new Address();
    address.setStreet("5th avenue");
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("person", person);
    params.put("address", address);
    ProcessInstance processInstance = ksession.startProcess("multiple-rule-tasks", params);
    assertEquals(1, listPerson.size());
    assertEquals(1, listAddress.size());
    assertProcessInstanceFinished(processInstance, ksession);
}
Also used : Address(org.jbpm.bpmn2.objects.Address) HashMap(java.util.HashMap) KieBase(org.kie.api.KieBase) ArrayList(java.util.ArrayList) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) TriggerRulesEventListener(org.jbpm.process.instance.event.listeners.TriggerRulesEventListener) Person(org.jbpm.bpmn2.objects.Person) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Address (org.jbpm.bpmn2.objects.Address)1 Person (org.jbpm.bpmn2.objects.Person)1 TriggerRulesEventListener (org.jbpm.process.instance.event.listeners.TriggerRulesEventListener)1 Test (org.junit.Test)1 KieBase (org.kie.api.KieBase)1 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)1 WorkflowProcessInstance (org.kie.api.runtime.process.WorkflowProcessInstance)1