Search code examples
javamysqldroolsjbpm

Workflow not forwarding after user task in jbpm5


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. 1. Could there be any configuration changes needed for jbpm5.0. 2. Is there anything else that im missing.

      KnowledgeBase kbase = readKnowledgeBase("taskprocess.rf");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

        /*Create the knowledge base for HelloProcss.bpmn */

        KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
        CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);
        //JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
        //taskHandler.connect();

        System.out.println(" started the humantask");
        ksession.startProcess("persistask");    
        ksession.fireAllRules();

Solution

  • 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