BPMN-WF Mapping: The GOTO problem

I expected that the transformation of a BPMN diagram to a WF workflow would be accomplished by mapping each BPMN Process to a Sequential Workflow. But, there is a structural difference between the BPMN diagram and the Sequential Workflow. The difference is that the Sequential Workflow is block-structured (i.e. all paths from a split or branch reconverge at a single node), while the BPMN diagram is a free form graph. The arbitrary sequence flows allowed in BPMN are similar to GOTO statements. Given that Sequential Workflows does not have a GOTO activity (see a related thread from MSDN forums), the transformation is not possible without redrawing (re-engineering) a semantically equivalent block diagram.

The problem is equivalent with the problem of transforming BPMN to BPEL. Bruce Silver wrote a useful post on the topic and Yi Gao (Chief Architect of eClarus Software) wrote an interesting white paper. From these sources I copied an example BPMN diagram that presents the problem of block-oriented representations (like Sequential WF and BPEL).

BPMN diagram

But, what if we map the BPMN diagram to a State Machine Workflow? Then we can solve at least the GOTO problem. We can map each task and each gateway of the BPMN to a State activity, which contains a single StateInitializationActivity, which executes its contained activities when entering the state. The State Machine Workflow diagram is the following:

WF State Machine Workflow

Each StateInitializationActivity which corresponds to a BPMN task contains two childs activities: one for the implementation of the task and a SetStateActivity which causes the transition to the next state. Each StateInitializationActivity which corresponds to a BPMN gateway also contains two child activities: an IfElseActivity to evaluate conditions and again a SetStateActivity which causes the transition.


About Panos

My name is Panos Kokkinidis and I am R&D Manager in Relational S.A., Athens, Greece.
This entry was posted in BPMN, Workflow Foundation. Bookmark the permalink.

2 Responses to BPMN-WF Mapping: The GOTO problem

  1. Marlon Dumas says:

    I think there is an implicit assumption in all this: that the BPMN process model contains no gateways that may lead to parallel activities, that is, no AND-split, AND-join, OR-split, OR-join, or complex gateway and perhaps no “concurrently repeated sub-processes”. Under this assumption, I think you can indeed translate a BPMN model into a state machine, except that the translation of exception handlers will be tricky: you will have to create a branch from each state affected by the exception into the sub-state-machine associated with the exception handler. In fact, with these restrictions, the BPMN model could be transformed into a structured one using existing GOTO-to-WHILE program transformations, albeit these transformations would completely change the structure of the model and also introduce some additional boolean variables for bookkeeping purposes.
    If the BPMN model contains parallelism, transforming it into a state machine is not really feasible. Well, we can still achieve this translation by computing all the possible interleavings of activities, but that would lead big spaghettis.

  2. Panos says:

    Marlon – thank you very much for your comment. In fact, I wouldn’t publish this post, if I had read your papers that I cite here before.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s