BPMN usage and tips

Are Floating Intermediate Events Valid? The issue is an intermediate event (e.g., message or timer) “floating” in a process or expanded subprocess alongside the regular flow, the one bounded by start and end events.  The floating event has a sequence flow out, leading eventually to end event, but no sequence flow in.

When Are Error End Events Legal? Is it valid to end a top-level process in BPMN with an error end event?

Posted in BPMN | Tagged | Leave a comment

Workflow (WF) Screencasts

  1. Your first sequential workflow
  2. Your first state machine workflow
  3. Running workflows in your .NET applications: Matt covers the basic steps to host workflows in your applications.  He covers the basic hosting steps in a console application, then jump in and run a workflow in an ASP.NET application. 
  4. Using persistence services in WF: Matt presents the basics of add persistence services into the workflow runtime using code or configuration.  Additionally, to show off the power of this feature in Windows WF, he uses two different host processes sharing a persistence store: the first host starts a workflow and then it persists, while the second host picks up the workflow after its configured delay and resumes the processing.
  5. Using the WCF Receive Activity in a workflow: Learn how to use the Receive activity in your workflows to implement WCF services as workflows. In addition, see how to use the WorkflowServiceHost class to host your workflow as a service.
  6. Using the WCF Send activity in Windows Workflow Foundation: Matt Milner presents  the basics of using the Send activity to consume a service from a workflow using WCF. 
  7. Creating Custom Activities:Matt Milner presents  the basics of creating custom leaf activities including how to use Dependency Properties to make your properties bindable.
Posted in Workflow Foundation | Tagged , | Leave a comment

Link – Synchronous call of a workflow from an activity

Jon Flanders provides an example where an activity creates and calls syncronously another workflow by using a custom service.

Posted in Workflow Foundation | Tagged | Leave a comment

Arbitrary loops (GOTO activities) in sequential workflows

The following BPMN diagram presents a situation where there is an arbitrary loop with two entry points (one before Task A and one before Task B) and one exit point (after Task C). In situations like that it is not possible to implement this loop with a WhileActivity, because the WhileActivity works only with well-structured loops (i.e. those that have one entry and one exit point).

BPMN diagram with arbitrary loop

In many cases, it is possible to implement a loop like that with a StateMachineWorkflow. However, in order to implement this loop inside a SequentialWorkflow, we must exploit the rather obscure EventHandlingScopeActivity.

According to the official documentation, “… an EventHandlingScopeActivity activity executes its main child activity concurrently with an EventHandlersActivity activity. Each EventDrivenActivity within the EventHandlersActivity might execute many times or not at all”.

According to Scott Allen, “… the EventHandlingScope activity is similar to a Listen activity in that it can have multiple branches waiting for events in parallel. We can view these branches by right-clicking the activity and selecting “View Events”. The primary difference between this activity and a Listen activity is that this event continues to listen for all events until its main child activity (the default view) finishes execution. Imagine we are setting up a workflow that will count employee votes over a period of 30 minutes. We could set the main child activity of the EventHandlingScope activity as a Delay activity, with a 30-minute timeout. We can then place event handling activities in the event branches that listen for Yes and No votes. This activity will continue to listen for the Yes and No events until the Delay activity completes in 30 minutes.”

The idea is to setup the appropriate event handlers and raise the events from inside (by emulating the receipt of an external event). A mathematically concrete presentation (by C. Ouyang, M. Dumas, S. Breutel, and A.H.M. ter Hofstede) of this technique can be found here and here.

The main child activity contains two activities: Raises the starting event and waits for the end event. For the example above we need to setup two event handlers. A rule of thumb is that we need one event handler for each activity that has two or more input flows.

The first event handler contains Task A and raises the event for the second event handler.

The second event handler contains the Task B activity and an IfElseActivity, which represents the first gateway of the diagram. Now, the IfElseActivity checks the first condition (a==1) and if true, we raise the event captured by the first event handler. If false, we execute Task C and invoke a second IfElseActivity, which represents the second gateway. This IfElseActivity checks the second condition (b==2) and if true, we raise the event captured by the second event handler, otherwise we raise the event that ends the activity (the event that the main child activity listens to).

A sample project containing the workflow of the above diagram can be downloaded from here.

Posted in BPMN, Workflow Foundation | Tagged , | 4 Comments

Marlon Dumas on BPMN-BPEL round-trip engineering

This is a copy of a very interesting answer of Marlon Dumas in the Workflow Research Forums:

The approach taken in eClarus is promising. However, I am afraid that this approach will break when it gets to BPMN processes where multiple instances of the same activity occur in parallel. Consider for example Figure 1(a) in page 4 of the following paper: http://eprints.qut.edu.au/archive/00002976/01/2976.pdf
You will notice that activity D may execute twice, and these two instances of activity D may occur concurrently (for example if B and C finish more or less at the same time).
Even worst, consider the example in Figure 1(c): the number of instances of D that may be active simultaneously is unbounded.
In the general case, such processes can not be mapped into BPEL structured activities, simply because BPEL structured activities can not generate multiple instances of the same activity. You can still go around a case like the one in Figure 1(a) by duplicating the path containing activity D (and assuming there is no cycle thereafter), but you’ll never manage to capture a case like Figure 1(c).
Up to now, the only way that we have found to map any BPMN diagram to BPEL is by relying on BPEL event handlers. BPEL event handlers have the characteristic that it is the only construct in BPEL 1.1, which allows an unbounded number of instances of the same activity to execute in parallel.
Of course, mapping BPMN models to BPEL defeats the purpose of getting readable models, and round-trip engineering is out of question from there on.
However, if we restrict ourselves to certain subsets of BPMN, some relatively simple algorithms can do the job, see for example: http://eprints.qut.edu.au/archive/00003615/01/3465.pdf
Using such a mapping, round-trip is achievable. This is where tools like eClarus are likely to play a role.
So in summary, don’t expect you can draw any BPMN diagram, hit the button, and get a readable BPEL def. that can then be reverted back to a BPMN model. This can only be (easily) achieved for some classes of BPMN diagrams. There are fundamental differences between BPMN and BPEL, and the mapping is far from trivial.
For some further discussions on this issue, see: http://itredux.com/blog/2006/02/03/the-nex…ocess-modeling/

Posted in BPMN, Workflow & BPM | 3 Comments

BPM Market Overview

OMG created a page as a follow up to the information provided at the Think Tank workshop held on May 23-25th 2006. From the keynote “BPM Market Overview” presented by Connie Moore, Vice President and Research Director of Forrester Information Delivery Research Group, I picked the following slides:





Posted in Workflow & BPM | Leave a comment

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.

Posted in BPMN, Workflow Foundation | 2 Comments