use of org.kie.api.runtime.manager.RuntimeManager in project jbpm by kiegroup.
the class ParalellLoopTest method testProcessMaryApproveJohnApprove.
@Test
public void testProcessMaryApproveJohnApprove() {
RuntimeManager manager = createRuntimeManager("org/jbpm/test/functional/ParalellLoopTest.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
// ksession.addEventListener(new TestProcessEventListener());
taskService = engine.getTaskService();
ProcessInstance processInstance = ksession.startProcess("hu.tsm.ParalellLoopTest");
assertProcessInstanceActive(processInstance.getId());
complete("john", "Approve");
complete("mary", "Approve");
assertProcessInstanceCompleted(processInstance.getId());
manager.disposeRuntimeEngine(engine);
manager.close();
}
use of org.kie.api.runtime.manager.RuntimeManager in project jbpm by kiegroup.
the class ParalellLoopTest method testProcessMaryApproveJohnReject.
@Test
public void testProcessMaryApproveJohnReject() {
RuntimeManager manager = createRuntimeManager("org/jbpm/test/functional/ParalellLoopTest.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
// ksession.addEventListener(new TestProcessEventListener());
taskService = engine.getTaskService();
ProcessInstance processInstance = ksession.startProcess("hu.tsm.ParalellLoopTest");
assertProcessInstanceActive(processInstance.getId());
for (int i = 0; i < 20; i++) {
logger.debug(">>> Loop: {}", i);
complete("mary", "Approve");
complete("john", "Reject");
}
// A Jóváhagyás folyamatnak vége
complete("john", "Approve");
complete("mary", "Approve");
assertProcessInstanceCompleted(processInstance.getId());
manager.disposeRuntimeEngine(engine);
manager.close();
}
use of org.kie.api.runtime.manager.RuntimeManager in project jbpm by kiegroup.
the class ParalellLoopTest method testProcessJohnReject.
@Test
public void testProcessJohnReject() {
RuntimeManager manager = createRuntimeManager("org/jbpm/test/functional/ParalellLoopTest.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
// ksession.addEventListener(new TestProcessEventListener());
taskService = engine.getTaskService();
ProcessInstance processInstance = ksession.startProcess("hu.tsm.ParalellLoopTest");
assertProcessInstanceActive(processInstance.getId());
for (int i = 0; i < 20; i++) {
logger.debug(">>> Loop: {}", i);
assertNodeTriggered(processInstance.getId(), "ApproveMary");
assertNodeTriggered(processInstance.getId(), "ApproveJohn");
String user = "john";
complete(user, "Reject");
}
// assertNodeTriggered(processInstance.getId(), "ApproveMary");
// assertNodeTriggered(processInstance.getId(), "ApproveJohn");
// A Jóváhagyás folyamatnak vége
complete("john", "Approve");
complete("mary", "Approve");
assertProcessInstanceCompleted(processInstance.getId());
manager.disposeRuntimeEngine(engine);
manager.close();
}
use of org.kie.api.runtime.manager.RuntimeManager in project jbpm by kiegroup.
the class ParalellLoopTest method testProcessAlternateReject.
@Test
public void testProcessAlternateReject() {
RuntimeManager manager = createRuntimeManager("org/jbpm/test/functional/ParalellLoopTest.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
// ksession.addEventListener(new TestProcessEventListener());
taskService = engine.getTaskService();
ProcessInstance processInstance = ksession.startProcess("hu.tsm.ParalellLoopTest");
assertProcessInstanceActive(processInstance.getId());
for (int i = 0; i < 20; i++) {
logger.debug(">>> Loop: {}", i);
assertNodeTriggered(processInstance.getId(), "ApproveMary");
assertNodeTriggered(processInstance.getId(), "ApproveJohn");
String user = "mary";
boolean alternate = true;
if (alternate && i % 2 == 1) {
user = "john";
}
complete(user, "Reject");
}
complete("john", "Approve");
complete("mary", "Approve");
assertProcessInstanceCompleted(processInstance.getId());
manager.disposeRuntimeEngine(engine);
manager.close();
}
use of org.kie.api.runtime.manager.RuntimeManager in project jbpm by kiegroup.
the class ParalellLoopTest method testProcessMaryReject.
@Test
public void testProcessMaryReject() {
RuntimeManager manager = createRuntimeManager("org/jbpm/test/functional/ParalellLoopTest.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
taskService = engine.getTaskService();
ProcessInstance processInstance = ksession.startProcess("hu.tsm.ParalellLoopTest");
assertProcessInstanceActive(processInstance.getId());
for (int i = 0; i < 20; i++) {
logger.debug(">>> Loop: {}", i);
assertNodeTriggered(processInstance.getId(), "ApproveMary");
assertNodeTriggered(processInstance.getId(), "ApproveJohn");
String user = "mary";
complete(user, "Reject");
}
// assertNodeTriggered(processInstance.getId(), "ApproveMary");
// assertNodeTriggered(processInstance.getId(), "ApproveJohn");
// A Jóváhagyás folyamatnak vége
complete("john", "Approve");
complete("mary", "Approve");
assertProcessInstanceCompleted(processInstance.getId());
manager.disposeRuntimeEngine(engine);
manager.close();
}
Aggregations