In this tutorial we show in three steps how to work with codelets in YAWL. We first create a codelet, install it and then invoke it from a YAWL workflow. We assume that you are familiar with editing and running workflows in YAWL.
Create Codelet
In the attached zip file you can find a codelet RandomNumberCodelet.java. In order to compile it you need the YAWL library jars from here:
https://github.com/yawlfoundation/yawl/releases/download/v4.1/YAWL_Libr…
Unzip and put yawl-lib-4.1.jar in your Java project. Also put jdom2-2.0.5.jar in your Java project (both jars are also in the zip file).
Compile the RandomNumberCodelet.java.
Install Codelet
Put RandomNumberCodelet.class in /opt/codelets/codelet - you can choose any other directory here. Open file
../YAWL-4.1/engine/apache-tomcat-7.0.65/webapps/resourceService/WEB-INF/web.xml
and change the following parameter accordingly:
<context-param>
<param-name>ExternalPluginsPath</param-name>
<param-value>/opt/codelets</param-value>
Run Codelet
Start the YAWL engine and load codeletInvocation.yawl into the YAWL editor. Run the workflow and see if a random number is displayed in the third task.