0 Replies Latest reply on Aug 13, 2014 4:40 PM by Quarie Zhang

    task not available immediately after startProcessInstance

    Quarie Zhang Newbie

      Hi, I installed jbpm 6.0.1.Final and did some test. I am a newbi to jbpm and very confused for the testing result. The test is based on the jbpm6-example.

       

      Below is the snippet.

       

      processInstanceId = processService.startProcess(

        "com.sample.bpmn", params);

       

        List<TaskSummary> taskListJohn = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");

       

        for(TaskSummary taskSummary: taskListJohn )

        {

        out.println("task for john: " + taskSummary.getName());

        }

       

      This snippet called by request doGet()

      The result is that taskListJohn is tempty.

       

      However, the next web request call to doGet() with the same snippet shows one task for john exists (e.g. buyticket).

       

      Does processService.startProcess(...) starts the process in another thread so that when the snippet runs the first time (first request) the result is not available yet?

      But to my understand that all this should be running on the same thread for one request.

       

      Thanks.