1 Reply Latest reply on Dec 29, 2010 9:16 PM by Kris Verlaenen

    "Waiting" process when interacting with jBPM5

    pawelp Newbie
      My problem is "hanging" process after interacting with jBPM.
      I start process (process with Human Task).
      Everything works fine, process starts, human task is generating, but my app never end...
      I think it "hangs" on CommandBasedWSHumanTaskHandler.
      What am I doing wrong?
      My code:

      My problem is "waiting" process after interacting with jBPM.

      I start process (process with Human Task).

      Everything works fine, process starts, human task is generating, but my app never ends...

      I think it is "waiting" on CommandBasedWSHumanTaskHandler.

      What am I doing wrong?

       

      Best regards

      Pawel

       

      My code:

      KnowledgeBase kbase = createKnowledgeBase("BPMN2-MinimalProcess.bpmn");
      StatefulKnowledgeSession ksession = createSession(kbase);
      CommandBasedWSHumanTaskHandler commandTaskHandler = new CommandBasedWSHumanTaskHandler(
                     ksession);
      ksession.getWorkItemManager().registerWorkItemHandler("Human Task",
                     commandTaskHandler);
      
      Map<String, Object> params = new HashMap<String, Object>();
      params.put("age", Integer.valueOf(14));
      Collection<ProcessInstance> processes = ksession.getProcessInstances();
      ProcessInstance processInstance = ksession
                     .startProcess("MyProcess", params);
      
        • 1. Re: "Waiting" process when interacting with jBPM5
          Kris Verlaenen Master

          What do you mean exactly with your app never ending?  Could you start it in debug mode so you can check where it is waiting exactly?  Looking at your sample code, it seems that your application should simply continue after calling startProcess.

           

          Your process instance however, if it includes a human task, is probably in a wait state, waiting for the human task to be completed (as the human task node will only continue if the task has been completed.  So in that case you can say that it is kinda waiting on the CommandBasedWSHumanTaskHandler to notify the process engine when the task has been completed.  If you want your process instance to continue, you should use a task client to complete the task (either one of the UIs or using code directly).

           

          Kris