Split and Join

Parallel transitions refer to transitions that execute simultaneously. From a given activity or depending on the outcome of a given activity, you can have more than one activity executing in parallel.

For example, once the status of a record is set to "approved", suppose work item notifications need to get sent to three different users with different roles. Each of these notifications is created in parallel, and after the necessary action is taken by all three, the workflow proceeds to the next task.

To define these transitions following pre-defined transition types, split and join can be used.

split

When the transition type is defined as split, it will fork execution for each transition that evaluates to true from the specified fromActivity.

<Transition FromActivity="UpdateProductStatusAsApproved" ToActivity="NotifyWorkItemPricing" type="split"/>
<Transition FromActivity="UpdateProductStatusAsApproved" ToActivity="NotifyWorkItemSchematics" type="split"/>

join

This transition type specifies the point where split or parallel transitions can join and proceed with the activity execution specified by the ToActivity.

<Transition FromActivity="NotifyWorkItemPricing" ToActivity="SetStatusToSuccess" type="join"/>
<Transition FromActivity="NotifyWorkItemSchematics" ToActivity="SetStatusToSuccess" type="join"/>

group

join transitions can be grouped together by specifying a group attribute. If a group attribute is not specified, all join transitions will belong to the default group.

grouplimit

Used with the group attribute to indicate number of transitions to be completed so join can proceed.

For example, if you have five parallel transitions and the grouplimit specified as three, the join will take place after completing three transitions. If not specified, all activities in the join group are required to complete for join to proceed.

<Transition FromActivity="NotifyWorkItemSchematics" ToActivity="SetStatusToSuccess"  type="join" group="notify" grouplimit="3"/>