[jboss-user] [jBPM] - Re: A question about rule task in jBPM5

Esteban Aliverti do-not-reply at jboss.com
Wed Nov 23 07:18:38 EST 2011

Esteban Aliverti [http://community.jboss.org/people/eaa] created the discussion

"Re: A question about rule task in jBPM5"

To view the discussion, visit: http://community.jboss.org/message/637923#637923

Using fireUntilHalt() is not recomended nowadays becasue it causes a bunch of problems like race conditions, rollbacks in TX and even loose of controll of your execution (you don't know in which thread is your process instance running!).
A better approach is to use an invocation pattern as the following one:

Each time you want to interact with a process, you need to execute these steps:
* get the session using JPAKnowledgeService (if you have different threads accessing the same session, it is recomended to queue all the access)
* invoque the desidered action: startProcess(), signalEvent(), completeWorkItem(), etc.
* invoque fireAllRules() this invocation is only useful if your process instances reached a Rule Node. If that is not the case, this invocation does nothing, so it is safe to execute it.
* dispose your session.

As far as I know, jBPM5 team and community are working in a more elegant solution that will encapsulate the call of fireAllRules() and make it transparent for the API user.

Best Regards

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111123/7512bcbf/attachment.html 

More information about the jboss-user mailing list