wishmaster7 [
https://community.jboss.org/people/wishmaster7] created the discussion
"jBPM 5.4 - setNode ?"
To view the discussion, visit:
https://community.jboss.org/message/797845#797845
--------------------------------------------------------------
Hi all,
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);
assertNodeTriggered(processInstance.getId(), "Start");
// find the user task
assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
//ksession = restoreSession(ksession, true);
WorkItem workItem = testHandler.getWorkItem();
assertNotNull(workItem);
assertEquals("admin", workItem.getParameter("GroupId"));
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?
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/797845#797845]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]