Question

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();
Was it helpful?

Solution 3

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

OTHER TIPS

That's happening because the thread that register the human task handler died (ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);) You need to have a global session with the Human Task handler attached listening the Human Task component for notification about Task Completions.

Cheers

Could you clarify how you are completing the task, are you using the Eclipse or web-based client for example? And what happens in your main class after starting the process, does it just terminate? In that case, Salaboy is probably right, as the thread that created the task and executing the process probably already died before you completed the task, so it will not continue execution.

Adding a long Thread.sleep in your main class would probably allow you to continue execution for testing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top