Discussion:
[jboss-user] [jBPM] - jBPM process not completed (sometimes)
Laura delli Paoli
2013-06-06 21:22:32 UTC
Permalink
Laura delli Paoli [https://community.jboss.org/people/lauradp] created the discussion

"jBPM process not completed (sometimes)"

To view the discussion, visit: https://community.jboss.org/message/821818#821818

--------------------------------------------------------------
Hello everybody,
I'm facing a strange problem on my bjpm process.
My process contains a human task (managed by an AsynchHornetQHTWorkItemHandlet), executed (started and then completed) by an extenal application through human task API (taskClient.start(...) taskClient.complete()). Sometimes (25-30% af times) after the human task has been completed the process doesn't continue its execution. When the process blocks human task's record in workItemInfo table is not deleted from the database..
Can anyone suggest me a solution  to this problem?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/821818#821818]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Demian Calcaprina
2013-06-07 02:22:44 UTC
Permalink
Demian Calcaprina [https://community.jboss.org/people/calca] created the discussion

"Re: jBPM process not completed (sometimes)"

To view the discussion, visit: https://community.jboss.org/message/821833#821833

--------------------------------------------------------------
The workItemHandler uses the session you inject into its constructor to continue the process:
https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AsyncGenericHTWorkItemHandler.java#L270 https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AsyncGenericHTWorkItemHandler.java#L270

is the session available and not disposed at the time you do task.complete?

Demian
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/821833#821833]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Laura delli Paoli
2013-06-07 09:02:22 UTC
Permalink
Laura delli Paoli [https://community.jboss.org/people/lauradp] created the discussion

"Re: jBPM process not completed (sometimes)"

To view the discussion, visit: https://community.jboss.org/message/821902#821902

--------------------------------------------------------------
*Thanks for your answer!*
*I create a session, with the same sessionId*

private StatefulKnowledgeSession createKSession(int sessionId, String processPath) {
                    // Create the kbuilder
                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();


                    // Add simpleProcess.bpmn to kbuilder
                    kbuilder.add(ResourceFactory.newFileResource(processPath), ResourceType.BPMN2);
                    System.out.println("Compiling resources");


                    // Check for errors
                    if (kbuilder.hasErrors()) {
                              if (kbuilder.getErrors().size() > 0) {
                                        for (KnowledgeBuilderError error : kbuilder.getErrors()) {
                                                  System.out.println("Error building kbase: " + error.getMessage());
                                        }
                              }
                              throw new RuntimeException("Error building kbase!");
                    }

                    // Create a knowledge base and add the generated package
                    KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
                    kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());

                    // return a new statefull session
                    return kbase.newStatefulKnowledgeSession();
          }
*and then I use this session to complete my workItem.*

*I never dispose my session.*
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/821902#821902]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Laura delli Paoli
2013-06-07 12:12:14 UTC
Permalink
Laura delli Paoli [https://community.jboss.org/people/lauradp] created the discussion

"Re: jBPM process not completed (sometimes)"

To view the discussion, visit: https://community.jboss.org/message/821941#821941

--------------------------------------------------------------
May my problem be due to this issue: https://issues.jboss.org/browse/JBPM-3582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel https://issues.jboss.org/browse/JBPM-3582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel??
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/821941#821941]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Demian Calcaprina
2013-06-07 17:27:45 UTC
Permalink
Demian Calcaprina [https://community.jboss.org/people/calca] created the discussion

"Re: jBPM process not completed (sometimes)"

To view the discussion, visit: https://community.jboss.org/message/822038#822038

--------------------------------------------------------------
It could happen because the task complete listener are not registered for some reason:
https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AsyncGenericHTWorkItemHandler.java#L120 https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AsyncGenericHTWorkItemHandler.java#L120

Maybe you can debug to see if TaskCompletedHandler( https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AsyncGenericHTWorkItemHandler.java#L216 https://github.com/droolsjbpm/jbpm/blob/5.4.x/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AsyncGenericHTWorkItemHandler.java#L216) is being called..
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/822038#822038]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Laura delli Paoli
2013-06-10 08:35:53 UTC
Permalink
Laura delli Paoli [https://community.jboss.org/people/lauradp] created the discussion

"Re: jBPM process not completed (sometimes)"

To view the discussion, visit: https://community.jboss.org/message/822231#822231

--------------------------------------------------------------
I'm using AsyncHornetQHTWorkItemHandler
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/822231#822231]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...