Pick First Groups

Pick first groups allow process execution to wait for one or more events. The first event that completes determines which transition to take to continue processing. For example, as part of an order-entry system, when an order is placed, a check is made to see if the order can be filled from stocked inventory or from returned merchandise. Whichever system returns the information first is used to fill the order. If neither system returns the information about available inventory, the order times out and cancels.

The following illustrates an example sub-process that uses the Pick First group to implement the business logic described above. The process is called and then a transition is taken to the Pick First group. The group then waits for either the return message from PollInventory, the return message from PollReturnedStock, or the Timeout activity. The first activity to complete determines the next transition taken. If either PollInventory or PollReturnedStock complete first, the transition to the ProcessOrder activity is taken. If the Timeout activity completes first, the transition to the CancelOrder activity is taken.

To specify the events that you would like to wait for, draw transition lines from the start of the group to the desired activities. Only request/reply, Wait for... activities, and activities that have the pause symbol can have valid transitions from the start of the Pick First group. If the transition is valid, the activity is highlighted in green. If the transition from the start of the group is drawn to an invalid activity, the activity is highlighted in red.