Java Reference
In-Depth Information
<targets>
<joinCondition>
$airplaneBooked and $hotelBooked
</joinCondition>
<target linkName="airplaneBooked" />
<target linkName="hotelBooked" />
</targets>
<compensationHandler>
<invoke name="handleReservationIssue" ... />
</compensationHandler>
<invoke name="submitExpenseReport" ... />
</scope>
</flow>
In this example, you have a process for creating a trip reservation that defines an operation
for booking air travel and another for booking a hotel. The flight and the hotel are handled
by your business partners, and your company policy dictates that the complete trip must be
booked before you can submit an expense report for the travel.
Therefore, you can't invoke the submitExpenseReport action until you know that both de-
pendent operations are complete. So you create two links, one for each action. Inside the activ-
ity that defines the action, specify each as a <source> to indicate that it is an object of interest
to be synchronized later.
NOTE
The names of links must be unique throughout the enclosing flow. So while technically you could
define the same link name twice in a process as long as they're in different flows, this is considered
bad form.
The two source activities (book airline ticket and book hotel reservation) are referred to as tar-
gets in the submitExpenseScope scope. That is, you specify a joinCondition that indicates
an expression combining the two link sources: once both are done, then the separate threads
of activity can join back into one, and execution can continue. The compensation handler will
be invoked if anything goes wrong, and the process will exit. If everything goes all right and
the travel is booked, and then you finally submit the expense report and the flow will end.
The joinCondition is a Boolean expression, in which a result of true will allow the flow to
continue.
Search WWH ::




Custom Search