Critical Control Flow Patterns

Một phần của tài liệu Ebook Business process management: Concepts, languages, architectures – Part 2 (Trang 76 - 81)

In this section sample process models with critical control flow patterns are investigated:Discriminator,N-out-of-M join, and Multiple Instances without Synchronization.

discriminator is used to realize a process in which the first offer is accepted, and the respective order is sent; other messages that might come in afterwards will be ignored.

Fig. 6.25.Ordering process with discriminator pattern

The process is distributed over four parties, a manufacturer and three suppliers. The manufacturer starts the process and sends requests for offers to the suppliers. It is assumed that all suppliers share the same behaviour: they either respond by sending an offer or do not respond. The process orchestration of Supplier 1, as well as its interaction with the process orchestration of a Manufacturer, is shown in Figure6.25.

The process orchestration of the supplier is explained as follows. After receiving a request from the manufacturer, anexclusive or gateway is used to decide about sending an offer. In case an offer is sent, the supplier expects to

receive an order in the Receive Order activity. If, however, no order arrives within a defined time interval, it is assumed that the manufacturer will not respond—represented by the timer event.

The process orchestration of the manufacturer starts by its requesting offers from suppliers. Then, the manufacturer expects the arrival of messages containing the offers sent by the suppliers. It is assumed that the manufacturer is in urgent need for material, so that the first offer that arrives will be taken.

This policy is realized by the discriminator pattern. Offers received after the discriminator fired will be ignored.

To see why this process is not sound, consider a concrete process instance based on the process model shown. Assume that the request messages have been sent and that Supplier 1 was the first to respond by sending an offer.

Consequently, the discriminator fires, an order is sent toSupplier 1, and the end event of the manufacturer’s process is reached.

If an offer is received from Supplier 2 after the manufacturing process has reached the end event, then this message is received by the Get Offer 2 activity. This activity, however, occurs after the end of the process instance has been reached! This is an example of improper termination, because activities are executed after the process has reached its end. Therefore, the process cannot be sound.

For the same reason, the process model cannot be weak sound. But the process is relaxed sound, because relaxed sound only makes sure that there are executions that are sound. Rather than formally proving this, we argue that the process is relaxed sound.

In order to do so, we have to show that each activity can participate in a sound process instance, that is, a process instance that reaches the final state.

Note that once the final state has been reached no activities can occur in the process.

Assume thatSupplier 1 sends an offer and Supplier 2 does not send an offer. In this case, the process reaches the final state, because the manufac- turer sends the order to Supplier 1, who can then terminate properly. Also, Supplier 2 can terminate properly because no further activities are required after deciding not to respond to the request.

If both suppliers send an offer, and Supplier 1 is the first to do so, then the manufacturer sends an order to Supplier 1. If the message bySupplier 2 arrives and the Get Offer 2 activity can terminate before the overall process terminates, then Supplier 2 will detect that no message will come in.

Also, in this example, the overall process reaches the final state. Since these considerations hold for both suppliers (swapping Suppliers 1 and 2 would have analogous results), we can conclude that all activities can participate in a process instance that reaches the final state: the process is relaxed sound.

business logic implements a process in which four offers are invited, and as soon as two offers have arrived, the manufacturer decides which offer to accept.

Each offer, however, will get compensation, realized by thePay offeractivities.

For ease of presentation, only one supplier is shown.

Fig. 6.26.Ordering process with N-out-of-M join

This process is not sound, because after the final state has been reached additional offers can be received by the manufacturer, and the respective payment activities are performed. These payment activities are ignored by the join, so that no deadlocks or livelocks will occur after the process terminates.

In workflow net terminology this means that a state is reachable in which there is a token in the final place owhile there are additional tokens in the net. Therefore, this process model is not sound.

Nevertheless this process model represents valid process instances, since the business goals are met: out of two offers an order is selected, and finally all offers which have been received have been compensated for.

Lazy soundness is designed to capture this semantics. The pay offer activi- ties are performed after the process has completed; these activities are known as lazy activities.

Multiple Instances without Synchronization

We now investigate the multiple instances without synchronization pattern with respect to the lazy soundness criterion. Assume a process model in which at some point multiple instances are created that are not synchronized.

This means that the process flow continues right after the start of these multiple instances, as discussed in Section4.1. Since there are no assumptions on the run time of the activity instances and these instances are not synchro- nized, it is obvious that the final activity of the process can be completed while some of the multiple instances created are still running. Therefore, pro- cess models featuring the multiple instances without synchronization pattern cannot be sound.

We can even argue that these instances are not even structurally sound, that is, not all nodes are on a path from itoo, in workflow net terminology.

An edge j k means that j needs to terminate before k can start. Ifj is an activity with the multiple instances without synchronization pattern, then k effectively starts before j has terminated. Therefore, the semantics of the control flow connector is violated. The multiple instances activity j spawns the instances j1, j2, . . . , jn, each of which is connected only toj. This means that these instances do not have any outgoing edges. Therefore they cannot be on a path from i to o, violating the workflow net property of structural soundness.

An example involving themultiple instances without synchronization pat- tern is shown in Figure6.27, where in the upper part there is a process model shown with sequential execution of activitiesA,B, andC, whereB is a mul- tiple instances without synchronization activity.

Fig. 6.27. Multiple instances without synchronization pattern, process model and process instance

system activity will spawn as many instances ofb as required.

In the process instance shown, mi(B) spawns the three instances and—

since the instances are not synchronized—control is immediately transferred to activity instancec, whose termination completes the process. It is obvious that b1, b2, andb3 can still be running after the end event of the process has been reached. Therefore, by the structure of this process, soundness is not satisfied.

Một phần của tài liệu Ebook Business process management: Concepts, languages, architectures – Part 2 (Trang 76 - 81)

Tải bản đầy đủ (PDF)

(156 trang)