The use case described in the topic Doubt canceling a timer and killing the tasks is, in practice, Van der Aalst's deferred choice pattern. A set of user tasks competing against each other and a deadline. The following jBPM features account for a neat solution to this problem:
Automatic timer creation/removal upon entering/leaving a node (timer subelement)
Leaving the task node upon ending the first task (signal attribute set to "first-wait"), ending the remaining ones (end-tasks attribute set to "true").
Thanks to boerse for suggesting the use case and complementing the solution.
The attached archive contains a process project created by the jBPM eclipse GPD. It contains a process definition showing the above situation, a few supporting handler classes and a JUnit test case demonstrating two scenarios:
a user completes one task; the process must cancel the remaining tasks and cancel the timer
users take too long; the process must cancel all tasks
Comments