2 Replies Latest reply on May 3, 2011 9:10 PM by Jim Hill

    jBPM 5.0 ProcessContext creation

    Jim Hill Newbie

      Michael Wohlfart gave me some good advise to upgrade my project to jBPM 5.0.0 and I am trying to do so.  I have the install configured, but the user guide has some holes in it.  I was reading through the online version at http://docs.jboss.org/jbpm/v5.0/userguide/ch03.html.  In 3.2 it discusses how to create a KnowledgeBuilder, a KnowledgeBase and a StatefulKnowledgeSession.  Then it jumps to using a ProcessContext called kcontext.  There is no instruction on how to create a kcontext.  It is referenced several times in chapter 3.  How do I create one of these?

       

      I am trying to take an external message that was received by my application and pass the object to the current state in the process.  I already know which process the message is for and have the process instance.  In jBPM 4.4 I used to do something like this:

       

      execution = getProcessInstance().findActiveExecutionIn(activityName);

      exectuionId = exectuion.getId();

      Map Parameters.put("message", msg);

      processInstance.signalExectuionById(executionId, "Message", parameters);

       

      What is the best way to accomplish the same thing with 5.0?  I assumed this would use the kcontext to get the current node kcontext.getNodeInstance().  Then use that to signal the current state and pass the message to it as I did before.  Can anyone point me to either documentation on this or an example.  Thanks!


      Jim