Hi John,
> About the implementation of the patternhttp://
workflowpatterns.com/patterns/control/state/wcp16.php(this
> question would be a good fit for a workflow pattern mailing list,
> could we create a google group for that ?)
Nice idea! The group is created and a copy of this reply will be send
to there.
- Hide quoted text -
- Show quoted text -
> If I look at the description of the pattern, I have to acknowledge
> that my implementation proposal doesn't comply : a branch has to
> execute completely before the other branches are withdrawn
> (cancelled). I have the impression that the pattern wants us to
> withdraw as soon as one branch as started.
> On the other hand, I have looked at the implementations matrix and
> noticed that BPEL implements this patterns by using the pick activity,
> while jBPM implements it by letting two transitions exit an activity.
> In Ruote that would boil down to :
> <sequence>
> <participant ref="wait_for_external_event__or__choose" />
> <subprocess field-ref="choice" />
> </sequence>
> or
> <sequence>
> <participant ref="wait_or_choose" />
> <if test="${field:choice} == blue">
> <blue-branch />
> <other-branch />
> </if>
> </sequence>
> Granted, variant 2 (<if>) is not as "atomic" as the <pick> BPEL
> construct. In both variants and in BPEL and jBPM there is no
> "withdrawal". If I take a look at the flash animation of the pattern,
> I don't see any withdrawal either.
> Is the proposal/withdrawal essential to this pattern ?
Yes, the proposal/withdrawal is essential to this pattern.
In workflow context two types of choices can be distinguished: 1) a
choice made by the (workflow management) system; and 2) a choice made
by the environment or the user. In the first case the choice is based
on data available to the system at the moment of choice. (This choice
is often referred to as an explicit choice.) In the second case the
choice is made "on the fly" and the data on which the choice is based
may not necessarily be available to the system. (This choice is
sometimes called implicit choice). The subtle difference is that in
the second case the choice on how the flow of execution will continue
is deferred until the actual moment of initiation of the corresponding
path/tasks. In order to make such a choice possible all alternative
paths/tasks need to be presented (i.e., enabled) to the environment/
user (as shown in the pattern animation). The moment the user makes
the choice (i.e., initiates one of the alternative branches/tasks) the
other alternatives gets automatically disabled (this is what I meant
with withdraw earlier). Note that a system could ask a user to enter
his/her choice in a preceding task (i.e., the second solution you
propose above). Then based on the data entered by the user, the system
could direct the flow to the corresponding path/task. Note, however,
that in this case the actual execution of the selected task can start
a lot later than the moment of choice.
I hope this explanation will help. If not, I would recommend the
following article "Three Good Reasons for Using a Petri-net-based
Workflow Management System" by Wil van der Aalst available on
http://is.tm.tue.nl/staff/wvdaalst/publications/p37.pdf
Kind regards, Petia