[jboss-user] [jBPM] - Re: blocking task in start-state does not block

Maurice de Chateau do-not-reply at jboss.com
Sun Apr 24 05:24:17 EDT 2011

Maurice de Chateau [http://community.jboss.org/people/MohReece] created the discussion

"Re: blocking task in start-state does not block"

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

Hey László,

The point you're missing here is that a task in a start-state has a different purpose than one in a task-node (which is, admittedly, not very clear from the documentation, but could be derived from  http://docs.jboss.com/jbpm/v3.2/userguide/html_single/#swimlaneinstarttask this section).

If you look at the jPDL definition, you'll see that there are only two node types that support tasks:
* task-node: for human tasks that are part of your business process and are assigned, started and ended *while the process is running*. It has support for the full task lifecycle (e.g. through the optional attributes create-tasks and end-tasks), including the 'blocking' semantics.
* start-state: for the sole purpose of being able *to start a process* by means of a human task. And therefore, blocking this makes no sense.

Take a closer look at the  http://community.jboss.org/message/390487#390487 unit test that is shown in the thread you referred to, and you'll see that in the test that has a task in its start-state, the process is started through a createStartTaskInstance() - taskInstance.end() sequence, before the token ends up waiting in the '+going steady+' state.

Your unit test starts the process in a different way (through the signal() call on the ProcessInstance). While this is still possible (i.e. having a task in the start-state doesn't prevent you from starting the process in another manner), it also means that in this case that task has no use anymore for this particular instance of the process, and therefore it is ignored completely.

So if you set out to have a blocking task as the first thing in your process, you need to do so with a task-node that directly follows your start-state. And actually, that's pretty much what you've done in your second unit test - but you just as well may omit your not-so-blocking task from the process definition.  ;) 


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/20110424/7de801c9/attachment-0001.html 

More information about the jboss-user mailing list