[jboss-user] [jBPM Users] - Starting process instance by key

bestage do-not-reply at jboss.com
Mon Oct 5 17:36:39 EDT 2009


Today in a project we are currently doing, I was suprised to find out that startProcessInstanceByKey(procDefId, key) allows to use the same key many times. Although it is clear that this is intended to be a business key,
I still wonder why it is not forced to be unique.

I actually planned to use this key as some sort of locking mechanism to lock the business object used by a process against being used in another process instance. Thus if I'd start another process instance with the same key whilst the previous one is running, I'd expect to get an exception.

Now, the only work around seems to be to check before starting a new process instance, if another process instance is running with the same key and not allow to start the new instance until the previous one is finished.

Does anyone have a better idea?



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258755#4258755

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258755



More information about the jboss-user mailing list