Users of Enterprise Architect may be aware of the use of “Gang of Four” Design Patterns (Gamma et al) in the use of software designs and the support that Enterprise Architect provides for using these “Gang of Four” patterns.
Enterprise Architect also provides facilities for modellers to create and share their own design patterns. Users of Enterprise Architect may be under the impression that creating and sharing your own patterns is restricted to UML class diagrams however this is not the case.
This newsletter presents an illustration of creating, using and distributing a Business Process Workflow pattern using BPMN 1.1
Business Workflow Patterns
The research work of Professor van der Aalst has resulted in the identification of 21 basic workflow patterns that describe the behaviour of business processes.
These patterns are divided into the following categories:
- Basic Control Flow Patterns
- Advanced Branching and Synchronization Patterns
- Structural Patterns
- Multiple Instance Patterns
- State-based Patterns
- Cancellation Patterns
However you are free to create your own modelling patterns.
For the purpose of this newsletter, I will describe the following pattern, which I will refer to as “Parallel Process Error Propagation”. This pattern is illustrated below:
This workflow patterns ensures that if an exception occurs, then this is handled by a common activity.
Creating the Pattern
To create your own pattern, you must first model the pattern using a diagram from your chosen notation (in this case a BPMN 1.1 Business Process Model Diagram). I would recommend that ALL elements are named so identification within the pattern is made much easier. So the pattern can be maintained I recommend that a separate Enterprise Architect project is used to model your patterns.
The diagram created must now be saved as a UML Pattern using the following steps:
- Select Diagram | Save UML Pattern… from the main menu. The following dialog displays
- Complete the dialog as follows:
- In the Pattern Name: field enter a name to identify your pattern
- In the Filename field, enter a directory path and filename in which to save the pattern
- In the Category field, enter a name under which your pattern will appear in the UML Patterns section in the Resources view
- In the Version field enter any desired version number and in the Notes field enter a description of your pattern
- Complete a selection for the actions that are available when the pattern is used
- Create: creates the pattern directly adding new elements to your model
- Merge: Uses existing elements in your model and assembles them into your pattern (refer to Limitations later in this newsletter)
- Instance and Role are only where Object, Ports or Parts are used within your pattern
- You can also enter a comment for each element in your pattern to give some guidance as to its purpose within the pattern
The illustration below shows a typical completion of the UML Pattern dialog
- After completing the dialog click OK to save your pattern
Importing the Pattern
In order to use your pattern, it must be imported into you modelling project:
- Select the Resources window (if this is not visible, then use the View menu to select the Resources view)
- Right-click on the UML Patterns node, and select Import UML Pattern
- Navigate to the file created when you saved your Pattern
- Click Open to complete the import process
If all has gone well, you should see you pattern in the Resources view as shown below:
Using the Pattern
To use your newly imported pattern, perform the following steps:
- Create a new diagram that matches the type used when the pattern was first created (for this newsletter, this would be a BPMN 1.1 Business Process Model
- Using the Resources view, locate the pattern and Drag and drop the pattern onto your diagram, the following dialog displays:
- Assuming that you wish to Create a new pattern, then for each element in the pattern click the … button and enter a new name (which can be blank) for your element. A typical example is shown below:
- Click OK and your pattern should appear on your diagram using the names you entered in the dialog. This is shown below:
(Note as the labels for the error intermediate event were hidden in the pattern, they are also hidden in the above diagram)
When creating patterns based upon PURE UML diagrams then
all features work without fault. However it is important to note that basing a pattern on a
UML Profile (which BPMN is) then the Merge option does not work, therefore for BPMN patterns it is not possible (currently) to use existing BPMN elements
and assemble them into a pattern. This limitation is being addressed in the next release of Enterprise Architect version 9.0 (currently in Beta 3.0).
In this newsletter we have described how create and use a pattern based upon a modelling notation other than UML.