[jboss-user] [jBPM] New message: "Re: Create process instance without starting it"

M M do-not-reply at jboss.com
Fri Feb 26 16:07:12 EST 2010


User development,

A new message was posted in the thread "Create process instance without starting it":

http://community.jboss.org/message/528911#528911

Author  : M M
Profile : http://community.jboss.org/people/gubespam

Message:
--------------------------------------------------------------
My system allows an outside client to trigger the start of a process instance, using the latest version of the process definition.  I have three requirements:1. Emit a notification whenever I start a new process instance ("start"); that notification must include the effective version (ie. the process definition version used to create the process instance).
2. Emit a notification whenever I reach a certain custom activity (this gets handled by code in the custom activity itself)
3. The start notification must occur before the custom activity notification.
 
It appears that the easy way would be to simply use executionService.startProcessInstanceByKey, use the returned ProcessInstance reference to determine the effective version, and then emit the start notification.
 
However, if I do that, the start notification will only get emitted after I've reached a wait state, which is guaranteed to be after the custom activity executes. This breaks requirement #3 above.
 
If, on the other hand, I can create a process instance without starting it, I can:
1. create the process instance, and from that reference, determine the effective version
2. emit the start notification, including the version determined above
3. start the process instance; when I reach the custom activity, emit the custom activity notification.
 
So, does that make sense? I had trouble clearly explaining this.


--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/528911#528911




More information about the jboss-user mailing list