0 Replies Latest reply on Jan 20, 2014 9:46 AM by suchinder.singh

    JBPM Consecutive process instances do not reach human task

    suchinder.singh

      Hi Guys,

       

      I am facing an issue where consecutive process instances do not reach human task. I have a workflow with two human tasks connected to each other (picture attached). I start two process instances consecutively. Both the process instances reach the first human task and I can see them in the tasks assigned to the actor of the first human task. Then I proceed them to the second human task. But only the first process instance reaches the second human task, and I see only one task assigned to the actor of the second human task. I am attaching my source code as well.

       

      Many Thanks

       

      Screenshot.jpg

      Code to view tasks assigned to actor

      TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1",
                          new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
      client.connect("127.0.0.1", 9123);
      
      BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
      client.getTasksAssignedAsPotentialOwner(actor, "en-UK", taskSummaryResponseHandler);
      taskSummaryResponseHandler.waitTillDone(MAX_WAIT_TIME);
      List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
      

       

      Code to proceed human task

      TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1",
                          new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
      client.connect("127.0.0.1", 9123);
      
      BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
      client.start( taskid, userid, responseHandler );
      responseHandler.waitTillDone(MAX_WAIT_TIME);
      
      responseHandler = new BlockingTaskOperationResponseHandler();
      client.complete( taskid, userid, null, responseHandler );
      responseHandler.waitTillDone(MAX_WAIT_TIME);
      

       

      Code to start process

      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
      kbuilder.add(ResourceFactory.newInputStreamResource(bpmnStream), ResourceType.BPMN2);
      KnowledgeBase kbase = kbuilder.newKnowledgeBase();
      
      StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
      MinaHTWorkItemHandler humanTaskHandler = new MinaHTWorkItemHandler(ksession);
      ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);
      
      ProcessInstance process  = ksession.startProcess(processname, null);