Is jBPM working in a real multithreaded environment?
Is there a specification how the thread interaction should work?
I looked for information on both topic but did not find any.
It seems that the current design/implementation allows to have two different
representations of the same task, both containing different data.
My problem:
A process definition will make the jBPM generate an event on task-assign. When executed
following happens:
* Thread A ends the previous task, jBPM continues execution.
* jBPM creates, assigns next task, triggers the event handler (also Thread A)
* The eventhandler dispatches a message to the actor of the new task
* The actor receives the message (other host, Thread B)
* Connects to the jBPM (Thread B) and tries to fetch the task information
* Depending on the transport speed, thread B will be so fast, that he asks for the task
when it is
** not yet assigned to him (causes not authorised exception)
** already there (everything ok)
The same game can be played using the task-create event, result:
* Task does not exist (error)
* Task already there (ok)
I added a loop around the getRemoteTaskInstanceInfo call because I know the Id of the task
from the message, so I can wait for it to appear.
Disadvantage: The code gets really ugly because every multithreaded jBPM interaction has
to retry an operation until it succeeds. Apart from that the workaround causes high server
load (polling) or inefficient timing (wait).
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025353#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...