SHOW:
|
|
- or go back to the newest paste.
| 1 | TrackingProcessEventListener processEvents = new TrackingProcessEventListener(); | |
| 2 | ksession.addEventListener(processEvents); | |
| 3 | ||
| 4 | Map<String, Object> params1 = new HashMap<String, Object>(); | |
| 5 | params1.put("personId", 1);
| |
| 6 | Person person1 = new Person(); | |
| 7 | person1.setId(1); | |
| 8 | WorkflowProcessInstance pi1 = (WorkflowProcessInstance) ksession.createProcessInstance(processId, params1); | |
| 9 | long pi1id = pi1.getId(); | |
| 10 | ||
| 11 | ksession.insert(pi1); | |
| 12 | FactHandle personHandle1 = ksession.insert(person1); | |
| 13 | ||
| 14 | ksession.startProcessInstance(pi1.getId()); | |
| 15 | ||
| 16 | Map<String, Object> params2 = new HashMap<String, Object>(); | |
| 17 | params2.put("personId", 2);
| |
| 18 | Person person2 = new Person(); | |
| 19 | person2.setId(2); | |
| 20 | ||
| 21 | WorkflowProcessInstance pi2 = (WorkflowProcessInstance) ksession.createProcessInstance(processId, params2); | |
| 22 | long pi2id = pi2.getId(); | |
| 23 | ||
| 24 | ksession.insert(pi2); | |
| 25 | ksession.insert(person2); | |
| 26 | ksession.startProcessInstance(pi2.getId()); | |
| 27 | ||
| 28 | person1.setName("John");
| |
| 29 | ksession.update(personHandle1, person1); | |
| 30 | ||
| 31 | try {
| |
| 32 | Thread.sleep(1000); | |
| 33 | } catch (Exception ex) {}
| |
| 34 | ||
| 35 | - | assertNull("First process should be completed", ksession.getProcessInstance(pi1id));
|
| 35 | + | assertNull("First process should be completed", ksession.getProcessInstance(pi1id));// here the process is still running !!! |