[jboss-user] [jBPM] - Re: Error on task complete.

Diego Aguirre do-not-reply at jboss.com
Fri Feb 22 10:27:41 EST 2013


Diego Aguirre [https://community.jboss.org/people/diaguirr] created the discussion

"Re: Error on task complete."

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

--------------------------------------------------------------
We finally managed to fix this problem so i post here what we did.
Before i describe our solution, further test shows that this happens on every scenario we could think of where there where more than one process active at the same time, created with diferent sessions. (subrpocess, creatted form services, by raw java code, etc...) *which is explicitly supported according to the documentation.*

First, since it was the only option we had left, we decided to try upgrading the bpm version to 5.4. As we are using an integrated enviroment inside a SOA-P server, we couldnt upgrade all the classes since the integration between JBPM5 and the ESB (jbossesb-bpm5.jar) has not a newer version we could find. 
The first problem we had was that the class CommandBasedHornetQWSHumanTaskHandler, that is the only WorkItemHandler that actually works with the default integration class (Bpm5Processor), isn´t just deprecated, but broken. Apparently the serialization mechanism on the human task service has changed since 5.1, but only the srerialization methods on CommandBasedHornetQWSHumanTaskHandler has been updated, but the deserialization ones haven't. Indignation asside, this "half updated class" was still the only class that kind of works (HornetQHTWorkItemHandler throws time out exception when trying to create the task) so we fixed it ourselves.

This being done, the application started working again as it was doing before the upgrade and the same error persisted (with a slithly diferent stack trace since the clases have changed).
After lots of tests and research we found the answer when we where trying to make HornetQHTWorkItemHandler work instead of CommandBasedHornetQWSHumanTaskHandler. Apparentrly, when there are more than one session simultaneously,  human task handlers are called many times form the different sessions that are alive, so, when you create a human task handler you must explicitly indicate that it must react only to events on its own session which for some reason isn't the default behavior. Even the CommandBasedHornetQWSHumanTaskHandler class has that option, but it isn't yet supported for the Bpm5Processor class, so we extended Bpm5Processor, setting it on true on every handler we create and this fixed the probelm. Sadly, this solutions wasn´t applicable to the version 5.1, at least not directly, since the old CommandBasedHornetQWSHumanTaskHandler doesn't have this option.

Just for the record, this answer isn't in the expected secction of the documentation, the one about multiple sessions and processes, but in the human task handlers section as a note, which makes it very tricky to find, since it was not obviously a handler issue.
--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130222/44dd0e00/attachment.html 


More information about the jboss-user mailing list