7 Replies Latest reply on Mar 16, 2012 1:15 AM by vinayknr41

    Workflow not progressing after user task

    arselv

      I have a user task in a workflow. Im able to process the human task but the flow is not forwarding further. Without any exception the flow stops there, other tasks following the user task is not getting executed.

      Kindly help me in this regard.  Could there be any configuration changes needed for jbpm5.0 or

      what else should i scrutinise to find the clue.


        • 1. Re: Workflow not progressing after user task
          arselv

          We need to add the user name administrator in the "TaskServiceSession" taskSession.addUser(new User("administrator"));

          With this the workflow progresses and completes the remaining tasks after the user task is completed.
          You must have the administrator role in order to run any process. It is a requirement.

          • 2. Re: Workflow not progressing after user task
            vinayknr41

            Hi Arun,

            I am still not getting what purpose the addtion of code will serve.

            Can you please give the process details also. I mean have you defined any owner for that task. If you have not assigned it then there may the need to create a user.

            I am facing the similar problem. Even if I say complete on the task, the workflow is not going forward.

            • 3. Re: Workflow not progressing after user task
              salaboy21

              So did you define the Administrator role? that role is required by the jBPM5 runtime to work. If you are getting the logs in the Human task server that the task was completed (and also looking in the database and it is completed) your session probably is not listening the human task server to continue the process.

               

              Cheers

              • 4. Re: Workflow not progressing after user task
                vinayknr41

                Hi I am using the demo setup. In the examples I have added one more process and a java program to execute that process.
                In the process I have a start Event -> Service Task -> User task -> End event. For the user task I have defined krisv as actor.

                When I am starting the process using persistence only then the workflow is not forwarded.

                 

                If I start the session like the following I am getting the error.

                return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);

                But when I create the session like the following workflow is forwarded properly.

                return kbase.newStatefulKnowledgeSession();

                 

                The processinstance log gives the following information.

                 

                Process 'ServiceTask' [1]

                Hibernate: select nodeinstan0_.id as id4_, nodeinstan0_.log_date as log2_4_, nodeinstan0_.nodeId as nodeId4_, nodeinstan0_.nodeInstanceId as nodeInst4_4_, nodeinstan0_.nodeName as nodeName4_, nodeinstan0_.processId as processId4_, nodeinstan0_.processInstanceId as processI7_4_, nodeinstan0_.type as type4_ from NodeInstanceLog nodeinstan0_ where nodeinstan0_.processInstanceId=? order by nodeinstan0_.log_date

                Triggered Node Instance 'ServiceTask#1' (Start) [1#0]

                Left Node Instance 'ServiceTask#1' (Start) [1#0]

                Triggered Node Instance 'ServiceTask#5' (Service Task) [1#1]

                Left Node Instance 'ServiceTask#5' (Service Task) [1#1]

                Triggered Node Instance 'ServiceTask#6' (User Task) [1#2]

                • 5. Re: Workflow not progressing after user task
                  vinayknr41

                  Hi,

                  I could solve the problem.

                   

                  Referring to the thread https://community.jboss.org/thread/171541.

                   

                  Thanks a lot!!

                  • 6. Re: Workflow not progressing after user task
                    salaboy21

                    It looks like you are not registering the Listener for the human task server.

                    You should register it using something like:

                    ksession.registerWorkItemHandler("Human Task", new CommandBasedWorkItemHandler(ksession,..... ));

                    This Version of the WorkItemHandler will handle persistence correctly.

                     

                    Cheers

                    • 7. Re: Workflow not progressing after user task
                      vinayknr41

                      Hi Mauricio,

                       

                      Thanks for the reply. It was that problem only.

                       

                      I have few doubts regarding the usage of history logs, versioning of process and human task server

                       

                      I am running the jbpm5 demo setup. In that I have created a process and a correspoding class to simulate the process and I have been experimenting with the different features of jbpm5

                       

                      1. Whenever I am starting a process, through log I am able to see where that process is active but I am not able to see on which node that process is pending. Using another query we can get that information but it is not available directly. ( The web console shows this information directly. How is it implemented there?)

                       

                      2. Suppose at time t1 I have created 3 instances for the process and at time t2 I have changed my process ( This is what I call the version2 of my process) Then again I created 3 more instances. After that will I be able to differentiate between the processes that with version1 and version 2?

                       

                      3. In demo setup we are using the h2 in memory database. Does jbpm5 use the same database for human task server? If no which database it uses and if yes/no how can I see the schema of the human task server?