Modeling
- Download and open the XPDLSample.vpp attached with this tutorial.
- Open the business process diagram Business Process Diagram1.

-
Right click on the background of the diagram and select XPDL Diagram from the popup menu. Without this step, some of the XPDL-related properties will be hidden.
To construct a business process. There are several main components: Process, Participant, Activity, and Transition. The names of the components may be different between VP-UML and XPDL. The following table shows the mapping between VP-UML and XPDL:
| VP-UML |
XPDL |
| Pool |
Process |
| Lane |
Participant |
| Task |
Activity |
| Sequence Flow |
Transition |
Let's go through the components one by one.
Process (Pool)
Process contains the variables, applications.
There are 2 kinds of variables: Formal Parameter, Data Field. Formal Parameters' values will be specified when starting the process instance. Both variables will be used by the applications.
Application will be triggered in activity. OBE provides a list of default applications that is enough for running a simple process.
- Right-click on the pool Document Approval and select Open Specification... from the popup menu.

-
Open the Formal Parameters tab, add the following formal parameters:
| Name |
Base Type |
Model |
| docUri |
String |
In |
-
Open the Data Fields tab, add the following data fields:
| Name |
Base Type |
| peerApproved |
Boolean |
| peerComments |
String |
-
Open the Applications tab, add the following applications:
| Name |
Application ID |
Formal Parameters |
| Document Editor |
obe.editDocument |
url:String (In) |
| Document Viewer |
ob2e.viewDocument |
url:String (In) |
| Update Process Attribute |
obe.updateProcessAttributes |
|
| Assign Process Attribute |
obe.assignProcessAttribute |
attrName:String (Out)
attrValue:String (In)
|
- Confirm pool editing by clicking OK.
Participant (Lane)
OBE's config file BasicSecurityRealm.xml has been defined a list of entries (users).
Participant id is used to to reference the entry.
Participant type defines which user will be assigned a work item when the activity is triggered.
- Right click on the lane Document Submittor and select Open Specification... from the popup menu.

- Open XPDL tab, enter Submittor to be Participant id.
- Confirm lane editing by clicking OK.
-
Repeat the above steps to set participant id and participant type for the lanes below:
| Lane |
Participant id |
Participant type |
| Peer in Sales Dept. |
Sales |
Organizational Unit |
| Vice President of Sales Dept. |
VPSales |
Role |
Activity (Task)
In XPDL, the instance of activity is called Work Item. User can work with the application(s) when the work item is assigned to him/her.
- Create a start event and end event to represents the start/end of the process.

- Right click on the task Edit Document and select Type > Service Task from the popup menu.

- Right click on the task again and select Open Tools Specification... from the popup menu.

-
Add the following tool:
| Name |
Application |
Actual Parameters |
obe.editDocument
(Note: Tool name has no impact on XPDL generation. It is just for ease of referencing)
|
Document Editor
(obe.editDocument)
|
DocUri : String
(XPDLFormalParameter)
|
- Confirm task editing by clicking OK.
-
Repeat steps 2-5 to add following tools for the task Peer Review:
| Name |
Application |
Actual Parameters |
| obe.viewDocument |
Document Viewer
(obe.viewDocument)
|
docUri : String
(XPDLFormalParameter)
|
| obe.updateProcessAttributes |
Update Process Attribute
(obe.updateProcessAttributes)
|
peerApproved : Boolean
(XPDLDataField)
peerComments : String
(XPDLDataField)
|
Transition (Sequence Flow)
Transition represents the flow between activities. Normally, no transition details need be specified for XPDL, except those conditional transitions that need to have their conditions specified.
- Right click on the sequence flow approve and select Open Specification... from the popup menu.

- Set the Condition type to be Expression.
- Enter $peerApproved in Condition expression. peerApproved is the variable name. The dolor sign is the identification of variable.

- Confirm sequence flow editing by clicking OK.
- Right click on the sequence flow reject and select Condition Type to be Default.

Deadline (Timer Trigger)
Deadline is used to define a time condition on the activity. Take a look at the task
Peer Review and its intermediate event. We want to model the fact that if
Peer have not review the document within 3 days, the document will be commented (
timed-out) and will be passed to
Vice President automatically. To do so, time condition need to set, and a new activity need be created between the event and the next activity for adding comment.
- To set the time condition, right click on the intermediate event timeout and select Open Specification... from the popup menu.

- Set the Time cycle to be 3D, which means 3 days.

- Confirm intermediate event editing by clicking OK.
- To add new activity between event and next activity, mouse over the outgoing sequence flow exhibiting from event, and click on the resource icon Split with Shape.

- Select Task from the popup menu.

- Name the task to be (peer timeout).
-
Repeat step 2-5 of above part Activity (Task), add the following tools:
| Name |
Application |
Actual Parameters |
| obe.assignProcessAttribute |
Assign Process Attribute
(obe.assignProcessAttribute)
|
PeerComments : String
(XPDLDataField)
(timed-out)
(Note: (time-out) is a parameter in text.)
|
The business process diagram is modified for OBE.
Generate XPDL
- Right click on the diagram's background and select Utilities > Generate XPDL... from the popup menu.

- Enter the File name and click Save. The XPDL file is generated.
Import XPDL to OBE
Start OBE
Refer to
http://obe.sourceforge.net,
Getting Started > Installing/Configuring/Verifying.
Make sure Database and JBoss are ready.
Start JBoss
Execute
startas in
$OBE_HOME/bin or directly execute the start script of JBoss.
(PS: executing startas depends on the startas in staging properties)
Import XPDL into OBE
Refer to
http://obe.sourceforge.net,
Examples > Overview > J2EE Workflow Server.
- Start OBE's configuration by executing cladmin in $OBE_HOME/bin.
- In the command prompt of the cladmin, enter 1 to select Set Client Protocol.

- Enter rmi as protocol.

- Press Enter to apply the default JNDI factory [org.jnp.interfaces.NamingContextFactory].

- Enter 2 to select Connect to connect.
- Press Enter (three times) to apply the default Host, User ID, and Password.
- Enter 4 to select Process Definitions to show sub-menu of Process Definition.

- Enter 3 to select Import Package to import the XPDL file.
- Enter the file path of the generated XPDL file. The process is imported into OBE. User can work on the process now.
Process execution
After the process definition is imported into OBE. User can instantiate the process and work on its instance.
Instantiate Process
- Start a web browser and visit http://localhost:8080/obeworklist.
- Login as system with User name system, Password password.

- Click the Processes link.
- A list of Process Definitions are shown. Click on the ID of the Document Approval.

- The details of the Process Definition is shown. Click the Instantiate link.

- A table of actual parameters are shown. They are the Formal Parameters defined in process.
- Set the name to be Promotion Document.
- Set the docUri to be xxx/promotion.txt. (Note: assumes the xxx/promotion.txt is a valid url that can be edited/reviewed by you.)
- Click the Start link to start the process instance.

- The details of the Process Instance is shown.

- Click Work Items link.

- A list of Work Items of this process instance is shown. Click ID of the work item Edit Document.
- The details of the work item Edit Document is shown. You should see that, the Performer is Submittor, the Participant is guest. (Note: Submittor is the user group, guest is a user of the user group. They are defined in OBE's config file BasicSecurityRealm.xml)
Working with Work Item
Work Item is the instance of an activity. Work Item may be assigned to a user (participant), that need be executed and completed by the user. On the previous section, the work item
Edit Document is assigned to
guest. Let's login as
guest and work on
Edit Document.
- Login as guest with User name guest, Password guest.
- Click the Worklist link.
- A list of work items that are assigned to this user is shown.
- Click the ID link of Edit Document. The details of it is shown.
- Click the Execute link to trigger the application(s) of this activity. On this activity, obe.editDocument will be triggered. If your docUri is a valid and editable file. The document editor will be shown to let you edit the document.
- After edited the document. Click Complete link to finish this work item. The state of this work item becomes closed completed. A new work item Peer Review of next activity will be created automatically.
- Login as system again. (User name system, Password password)
- Click the Processes to show the list of process instances.
- Click the ID to show details of process instances.
- Click the Work Items to show the list of work items. You should see that there are 2 work items. Edit Document is completed, while Peer Review is running.
- Click the ID of Peer Review. The details is shown. Since the Participant type of Peer Review is Organizational Unit, both Performer and Participant are Sales, no user will be assigned as its participant.
- Click the Execute link to trigger the application(s) of this activity. There are 2 applications defined in this activity: obe.viewDocument shows a document viewer for reading the document. obe.updateProcessAttributes shows a table to let user entering the value of variables. To represent the user has approved this document, select the peerApproved check box and click the Update link.

- Click the Complete link to complete this work item. (Note: If peerApproved is true, a new work item of Vice President Review will be created. Otherwise, the work item of Edit Document will be re-opened and assigned to guest again.)
Resources
- sample.xpdl
- XPDLSample (after XPDL).vpp
- XPDLSample (before XPDL).vpp
Comments (1)
written by Xexilia on December 16, 2011
Great atrclie, thank you again for writing.