Reusing YAWL specifications as subworkflows (till YAWL 3.x)
Imagine that you have a YAWL specification that you want to reuse as a subworkflow inside other workflows. The problem with ordinary subnets in YAWL specifications is that they cannot be reused elsewhere. This problem can be solved using worklets. In this tutorial we will show the special case of a worklet that is being used as a subworkflow. For this we do not need the rules editor because the rule tree consists of only two nodes.
The first thing to do is to create the workflow that is going to be used as a subworkflow. In our case it takes an input parameter and displays it (DisplayValue.yawl). This specification must be placed in the following directory:
Then we create a workflow that calls the subworkflow (MainProcess.yawl). In the task ShowValue we select "the worklet service" as the custom service as depicted on the following screen:
We upload the specification MainProcess.yawl to the engine.
The third step consists of "connecting" the worklet with the specification. In this very simple case it is quicker to directly edit the rules file than to use the rules editor.
We upload the rules file MainProcess.xrs to the following directory:
Now we are ready to test if it works. We start a case for MainProcess and assign the workitem ShowValue to some existing user. When the user views the work item it should look like this:
It is important that it says "Display value". If it says "ShowValue" it is not the worklet but the default behaviour of the MainProcess that is displayed.