Dynamic Flexibility and Exception Handling

The YAWL system provides support for flexibility and dynamic exception handling through the concept of worklets, an extensible repertoire of self-contained sub-processes and associated selection rules, grounded in a formal set of work practice principles derived from Activity Theory. This approach directly provides for dynamic change and process evolution without having to resort to off-system intervention and/or system downtime.

Flexibility is supported by allowing a process designer to designate certain tasks to each be substituted at runtime with a dynamically selected worklet, which contextually handles one specific task in a larger, composite process activity. An extensible repertoire of worklets is maintained for each task in a specification. When a task is enabled, a choice may be made from the repertoire based on the contextual data values within the task, using an set of ripple-down rules to determine the most appropriate substitution. The task is checked out of the YAWL engine, the corresponding data inputs of the original task are mapped to the inputs of the worklet, and the selected worklet is launched as a separate case. When the worklet has completed, its output data is mapped back to the original task, which is then checked back into the engine, allowing the original process to continue.

The worklet executed for a task is run as a separate case in the engine, so that, from an engine perspective, the worklet and its parent are two distinct, unrelated cases. The worklet service tracks the relationships, data mappings and synchronisations between cases. Any number of worklets can form the repertoire of an individual task, and any number of tasks in a particular specification can be associated with a worklet. A worklet may be a member of one or more repertoires that is, it may be re-used for several distinct tasks within and across process specifications.

The worklet concept extends to dynamic exception handling by allowing designers to define exception handling processes (called exlets) for parent workflow instances, to be invoked when certain events occur and thereby allowing execution of the parent process to continue unhindered. It has been designed so that the YAWL engine, besides providing notifications at certain points in the life cycle of a process instance, needs no knowledge of an exception occurring, or of any invocation of handling processes. Additionally, exlets for unexpected exceptions may be added at runtime, and such handling methods automatically become an implicit part of the process specification for all current and future instances of the process, which provides for continuous evolution of the process while avoiding any need to modify the original process definition.

Example of a process-exlet-worklet hierarchy

Exception handling, when enabled, will detect and handle up to ten different kinds of process exceptions. As part of the exlet, a process designer may choose from various actions (such as cancelling, suspending, completing, failing and restarting) and apply them at a task, case and/or specification level. And, since exlets can include compensatory worklets, the original parent process model only needs to reveal the actual business logic for the process, while the repertoire of exlets grows as new exceptions arise or different ways of handling exceptions are formulated.

An extensible repertoire of exlets is maintained for each type of potential exception within each workflow specification. If an exlet is executed that contains a compensation action (i.e. a worklet to be executed as a compensatory process) it is run as a separate case in the enactment engine, so that from an engine perspective, the worklet and its `parent' (i.e. the process that invoked the exception) are two distinct, unrelated cases. Since a worklet is launched as a separate case, it may have its own worklet/exlet repertoire. Any number of exlets can form the repertoire of an individual task or case. An exlet may be a member of one or more repertoires. The exception handling repertoire for a task or case can be added to at any time, as can the rules base used, including while the parent process is executing. Worklets and exlets can be used in combination within particular case instances to achieve dynamic flexibility and exception handling simultaneously.

More detailed information about worklets and exlets can be found here