I am quite new with jBPM and in my project the customer wants to be able to change manually the current state of the process. I've red some threads about setNode() but I'm unable to reach this method. Someone could please help me?
I have a small jUnit test class which extends JbpmJUnitTestCase, and my method looks like :
// start context
KnowledgeBase kbase = createKnowledgeBase("bpmn/TestSetNode.bpmn");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
TestWorkItemHandler testHandler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", testHandler);
// start process
ProcessInstance processInstance = ksession.startProcess("ch.orange.mnp.test.SetNode", null);
// find the user task
//ksession = restoreSession(ksession, true);
WorkItem workItem = testHandler.getWorkItem();
I can call ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null); to complete the User Task. But instead, I want to change the actual state of the process, let's say set it to "Script Task 1". How can I do that?