It seems that in YAWL you have the possibility to link the task to its external implementation in three ways:

1. a codelet, that is a simple Java class that at minimum must extend AbstractCodelet and override the method execute()
2. the worklet, that is more complicated, can involve other specifications and I don't want to discuss it here.
3. a custom service, that must implement one of the YAWL interfaces for custom services. It can be implemented in any language, but there's builtin an implementation in Java. It's more complicated and offer a richer API.

For the little I know, I suppose I can do what custom services do calling the YAWL API directly in the execute() method of a codelet. It seems the codelet is a simpler way to do what custom services do.

If I'm wrong, what's the difference between a codelet and a custom service? When to use the first and when to use the second?

This is a good question. If you look at the Worrkflow Reference Model of the Workflow Management Coalition there is an Interface 3 for Invoked Applications. From my point of view, it is the YAWL codelet that is the standard implementation of this interface. I would use a codelet for all connections to other IT systems.

I see the custom service more like the possibility of extending the capabilities of YAWL itself. An example is the Mail Service that allows you to send e-mails from inside workflows.

The worklet/exlet approach is for implementing flexibility of workflows. There is a whole lot of functionality that is explained in the YAWL book (Modern Business Process Automation) and in the YAWL User Manual. Also very simple things like reusing a specification as a sub workflow in several specifications are only possible with the worklet service.

Marco Sulla

Thu, 06/27/2019 - 23:01

Thank you for the clarification.

In the Technical Manual:
http://www.yawlfoundation.org/manuals/YAWLTechnicalManual2.1.pdf

there is an Interface B, that is an interface for external applications. But there are other interfaces: A, E and X.

Interface A is particulary interesting: it's said that it allows "the uploading and unloading of specifications, and registering, modifying and removing Custom Service and Client Application".

Do you think this can be done also with a codelet using the YAWL API?