|
Workflow Editor
The SmartProducts Workflow Editor (SPWE) is a tool to enable smart products developers to create or edit process definitions, including those generated by the Workflow Extractor components. Process definitions are edited using a graphical, graph-based notation known as BPMN (Business Process Modelling Notation), and the files generated from these process models are saved in an XML-based serialisation format known as XPDL (XML Process Definition Language). The workflow editor is an extension of an open source workflow editor called JaWE [JaWE] with specific support for the semantic annotations required for smart products.
Developer: Philip Webster
License
SPWE is licensed under version 2.1 of the Lesser GNU General Public License (LGPL 2.1). This permits portions of the code to linked from other programs as a library without constraining the linking program’s licensing conditions, but requires that all modification to the original code are published under the same license.
Download
The SmartProducts Workflow Editor (SPWE) is available in source form from the SmartProducts Subversion repository at the following location: https://trac.tk.informatik.tu-darmstadt.de/svn/projects/SmartProducts/SmartProducts/ To download the source code prior to building the editor, use the following command at a shell prompt:
Svn co https://trac.tk.informatik.tu- darmstadt.de/svn/projects/SmartProducts/SmartProducts/ This will check out the entire SmartProducts source tree. The SPWE code can be found in a subdirectory called ‘apps/wfed’
Building the editor An Ant script is provided to allow to user to easily compile and package the editor. To execute this script, Cd apps/wfed Ant clean buildAll
Once the editor has been built successfully, enter the directory where the executable is located, and run the ‘run’ script:
cd output/twe-2.3-1-community/bin
./run.sh
How to get started
Loading an ontology file
The SmartProducts workflow Editor supports the loading of OWL and RDF ontologies in order to allow the user to associate individuals (instances of ontology classes) with XPDL elements. This is achieved through a panel in the centre of the editor windows called the ‘Ontology View’.
The Ontology view can be opened by clicking on the ‘Ontology View’ tab beside the ‘Graph view’ and ‘XPDL View’ tabs. The ontology view panel will initially be empty, with a large white area where the ontology structure will be displayed, and a toolbar at the top with ‘Load’ and ‘Clear’ buttons. Figure 1 shows this panel, its associated toolbar, and some sample ontology data loaded into the panel.
The ‘Load’ button opens a dialogue that the user can use to navigate the local file system to locate an OWL ontology to load into the editor. The ‘Clear’ button deletes any loaded ontologies from the in-memory model. This is useful in situation where an incorrect ontology is loaded by accident.
Figure 1: Ontology view with an OWL hierarchy from a loaded OWL file
Creating a simple process definition
SPWE allows XPDL process definitions to be created using a graphical BPMN view consisting of a toolbar where various BPMN elements are located, and a graph area where the current process is visualised. The graph view can be opened by clicking on the ‘Graph View’ tab.
In this example, a simple cocktail process will be created, which will be annotated using the cocktail ontology. The cocktail that will be created is a Dry Martini. The recipe for this cocktail is shown below.
Dry Martini Four parts gin One part dry vermouth Green olive or lemon twist to garnish Shake or stir according to preference
In the example, one activity will be created to describe the addition of each ingredient to the cocktail. In addition, the action of shaking or stirring the drink will also be an action.
Creating a new package and process
XPDL processes are contained in packages. The first steps to take when opening the editor are to create a new package, and to create a new process. The new process will be placed into the newly created package automatically.
A ‘Create new package’ button is presented on the toolbar at the top of the main window. An ‘Insert new process’ button is also presented on the same toolbar, about half way across the toolbar’s length. Click on the ‘Create new package’ button, and then click on the ‘Insert new process’ button. The SPWE window will look like Figure 2 below.
Figure 2: SPWE with a newly created package and process awaiting elements
As this process is for a SmartProducts scenario, one smart device will be included as a participant, alongside the human user. This gives a total of two participants.
In the Graph view toolbar, click on the icon for a participant. This is an icon depicting the head and shoulders of a person. Next, click in the graph display area below the toolbar. This will add a participant to the process with a default name and will render the participant as a BPMN ‘swim lane’ in which that participant’s activities will be displayed. Click in the graph display area again. This will add a second participant, which can be redefined to represent the ‘system’ participant (meaning a computer implementation that acts as a participant in a process, rather than a person.)
Redefining the properties of the participants
Activate the ‘select tool’ by clicking on the icon in the toolbar with a picture of the mouse pointer on it. This tool allows the user to double-click on BPMN elements to summon a dialogue that allows various element properties to be added and modified. In the case of the human participant, the only modifications required are to give a more user-friendly name. The second participant requires some more advanced modifications.
Annotating participants with SmartProducts metadata
Participants are annotated with SmartProducts annotations using a special type of Extended Attribute element that has a ‘name’ value that matches one of a predefine set of reserved attribute names. For Participant elements, annotations can be named either ‘METADATA’ or ‘SP_CLASS’. The Extended Attributes editor for Participants can be accessed first by double-clicking on a participant in the BPMN graph view while using the select tool. The user will see a window like that shown in Figure 3, with the Extended Attributes editor taking up the bottom portion of the window.

Figure 3: Participant Extended Attributes panel with no content
The Extended Attributes panel has buttons for creating, editing and deleting attributes. These are the three buttons shown above the empty list of attributes. In this case, the aim is to add an element, so the first button should be clicked. This will cause a new window to be opened, which is the Extended Attributes dialogue shown in Figure 4. This dialogue box has been written specifically for SmartProducts, and allows either free text entry of an Extended Attribute’s name and value, or constrained selection of SmartProducts annotation names appropriate to the parent element, and OWL individuals from the loaded ontology model. If no OWL ontology is loaded, no SmartProducts annotations can be created.
Figure 4: SmartProducts Extended Attributes dialogue box
Creating activities
For each of the steps in the recipe, an Activity element must be created. In this simple example, most of the activities will be performed by the barman, but one activity will involve a smart product, namely a smart drinks mixer. Add five activities to the Barman participant’s swimlane by first clicking on the activity button in the toolbar (a green square icon), and then clicking in the desired swimlane in the BPMN graph view. Add one activity to the smart mixer participant’s swimlane in the same way. Use the select tool and double click on each of the activities to open the properties dialogue and rename these activities to human-readable descriptions of the actions to be taken. These are:
- Add gin
- Add vermouth
- Add ice
- Shake or stir (performed by smart mixer)
- Pour into glass
- Add garnish
Annotating activities
Each of the activities in the recipe can be annotated with ingredients, equipment classes, and ‘verbs’ describing the kind of action being performed. The cocktail ontology includes suitable examples for each of these types of annotation.
Activities can have three types of SmartProducts annotation applied to them: ACTIVITY, METADATA and SP_CLASS. Addition of these annotations is performed in the same way as with Participant annotation. The corresponding properties panel for an Activity element is shown in Figure 5. In this case, the Extended Attributes editor is accessed by clicking on the ‘Extended attributes’ tab, which will reveal the attribute list shown in Figure 6. This is due to the relatively higher number of attributes that can be applied to an XPDL Activity element, compared to a Participant.
The METADATA annotation is used to hold resources. In this case, ingredients defined in the cocktail OWL ontology can be applied as values for the METADATA annotation. Add a METADATA annotation for each XPDL Activity element, with the value set to the ingredient mentioned in the recipe.

Figure 5: Activity properties window

Figure 6: Activity Extended Attributes panel
Adding transitions
Transitions determine the flow from one activity to another, and can be unconditional or conditional. For this simple example, unconditional transitions will be used to create an unbranching, linear flow through all of the activities that make up the Dry Martini recipe.
The transition tool can be found on the toolbar in the Graph view panel. Click on this button, then click on an activity. When the pointer is moved around the graph view, an arrow extends from the selected activity to the pointer. Move the pointer to the target activity and click. This will anchor the transition. Now repeat this same action, until all activities have been linked together in sequence. Transitions can cross swim lanes – this is the way in which control is transferred from one participant to the next. An example of a chain of activities linked by transitions is shown in Figure 7.
Figure 7: Activities with transitions showing process flow
Transitions do not have a SmartProducts annotation type, so after the transitions have been defined, no further action needs to be taken for this example.
Adding start and end nodes
So far the process that has been created has a series of nodes interconnected by transitions. The start and end nodes must be defined explicitly, as it is not immediately obvious in some more complex process which should be the starting point. SPWE can place the start and end markers automatically. To do this, click on the ‘Add start/end nodes’-button on the toolbar.
A screenshot of the completed Dry Martini process definition is shown in Figure 8 below. In the screenshot, the system participant and all of the activity elements have been annotated with SmartProducts annotations. They are displayed in brown to indicate this to the process designer.
Figure 8: A completed process definition with SmartProducts annotations
1.1.1 More Complex Example
SPWE supports the entry of multiple values for each SmartProducts annotation. This can be used to provide a list of ingredients, or to provide a list of alternative device types that could perform a given action. By providing this much richer information in a process definition, the process designer can allow the workflow engine more flexibility when executing the process and when selecting candidate participants from the available pool of smart products.
In the example given in the previous section, one ingredient annotation was applied to each activity, and one SP_CLASS annotation was applied to each smart product participant. By repeatedly adding relevant annotations, a richer process can be created. The interpretation of the process depends on the available devices in a SmartProducts environment, and the provision of multiple SP_CLASS annotations can aid the execution engine when binding appropriate smart products to roles in a process.
API Documentation
JaWE consists of a number of modular APIs that are wrapped by an overall editor framework. These APIs include the XPDL reader/writer and components for displaying BPMN diagrams and XPDL source code. SPWE adds an additional component for displaying a hierarchical view of OWL individuals, adds modification to the existing BPMN viewer to highlight elements with SmartProducts annotations, and includes changes to the editor framework to add SmartProducts annotation features to pop-up dialogues.
Additional Material
|