use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler in project jbpm by kiegroup.
the class DataTest method testEvaluationProcess3.
@Test
public void testEvaluationProcess3() throws Exception {
KieBase kbase = createKnowledgeBase("BPMN2-EvaluationProcess3.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
ksession.getWorkItemManager().registerWorkItemHandler("RegisterRequest", new SystemOutWorkItemHandler());
Map<String, Object> params = new HashMap<String, Object>();
params.put("employee", "john2");
ProcessInstance processInstance = ksession.startProcess("Evaluation", params);
assertProcessInstanceCompleted(processInstance);
}
use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler in project jbpm by kiegroup.
the class EndEventTest method testOnEntryExitScriptDesigner.
@Test
public void testOnEntryExitScriptDesigner() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-OnEntryExitDesignerScriptProcess.bpmn2");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new SystemOutWorkItemHandler());
List<String> myList = new ArrayList<String>();
ksession.setGlobal("list", myList);
ProcessInstance processInstance = ksession.startProcess("OnEntryExitScriptProcess");
assertProcessInstanceCompleted(processInstance);
assertEquals(4, myList.size());
}
use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler in project jbpm by kiegroup.
the class EndEventTest method testOnEntryExitMixedNamespacedScript.
@Test
public void testOnEntryExitMixedNamespacedScript() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-OnEntryExitMixedNamespacedScriptProcess.bpmn2");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new SystemOutWorkItemHandler());
List<String> myList = new ArrayList<String>();
ksession.setGlobal("list", myList);
ProcessInstance processInstance = ksession.startProcess("OnEntryExitScriptProcess");
assertProcessInstanceCompleted(processInstance);
assertEquals(4, myList.size());
}
use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler in project jbpm by kiegroup.
the class EndEventTest method testOnEntryExitNamespacedScript.
@Test
public void testOnEntryExitNamespacedScript() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-OnEntryExitNamespacedScriptProcess.bpmn2");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("MyTask", new SystemOutWorkItemHandler());
List<String> myList = new ArrayList<String>();
ksession.setGlobal("list", myList);
ProcessInstance processInstance = ksession.startProcess("OnEntryExitScriptProcess");
assertProcessInstanceCompleted(processInstance);
assertEquals(4, myList.size());
}
use of org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler in project jbpm by kiegroup.
the class FlowTest method testMultiInstanceLoopCharacteristicsTaskWithOutput.
@Test
public void testMultiInstanceLoopCharacteristicsTaskWithOutput() throws Exception {
KieBase kbase = createKnowledgeBaseWithoutDumper("BPMN2-MultiInstanceLoopCharacteristicsTaskWithOutput.bpmn2");
ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new SystemOutWorkItemHandler());
Map<String, Object> params = new HashMap<String, Object>();
List<String> myList = new ArrayList<String>();
List<String> myListOut = new ArrayList<String>();
myList.add("First Item");
myList.add("Second Item");
params.put("list", myList);
params.put("listOut", myListOut);
assertEquals(0, myListOut.size());
ProcessInstance processInstance = ksession.startProcess("MultiInstanceLoopCharacteristicsTask", params);
assertProcessInstanceCompleted(processInstance);
assertEquals(2, myListOut.size());
}
Aggregations