[jboss-user] [jBPM] - jBPM 5.4 - setNode ?

wishmaster7 do-not-reply at jboss.com
Fri Feb 15 05:09:28 EST 2013


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&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130215/f0797343/attachment-0001.html 


More information about the jboss-user mailing list