How do I represent concurrent actions in jBPM, any of which can end a process?

Posted by tpdi on Stack Overflow See other posts from Stack Overflow or by tpdi
Published on 2010-06-05T00:41:42Z Indexed on 2010/06/07 1:42 UTC
Read the original article Hit count: 306

Filed under:
|
|

An example: a permit must be examined by two lawyers and one engineer. If any of those three reject it, the process enters a "rejected" end state. If all three grant the permit, it enters a "granted" end state. All three examiners may examine simultaneously, or in any order.

Once one engineer has granted it, it shouldn't be available to be examined by an engineer; once two lawyers have examined it, it shouldn't be available to lawyers; once one engineer and two lawyers have examined it should go to the granted end state.

My initial thinking is that either I have a overly complicated state transition diagram, with "the same" intermediate states multiply repeated, or I carry (external) state with the process { bool rejected; int engineerSignoffId; int lawyer1SignoffId; int lawyer2SignoffId}.

Or something like this? If so, how does the engineer's rejection terminate the subprocess that is in "Lawyers"?

START->FORK->Engineer->Granted?---------------->Y->JOIN-->Granted
          |->Lawyers-->Granted?->by 2 lawyers?->Y---^
                  ^                          |
                  |--------------------------N 

What's the canonical jBPM answer to this? Can you point me to examples or documentation of such answers?

Thanks.

© Stack Overflow or respective owner

Related posts about concurrent

Related posts about jbpm