Open Editions

Open Editions

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

The new Web Services - Human Task Lifecycle for Usertasks

By Deepak Joseph posted 2 days ago

  

In BAMOE workflows built with BPMN, User Task is a special type of activity that cannot be automatically executed by the workflow engine, requiring the manual intervention of a user. When a process instance reaches a User Task node, a new User Task is created and the process instance is stopped waiting for the completion of the User Task. Once the User Task completes, the process can continue its execution normally.

The User Tasks subsystem is responsible for the execution of User Tasks initiated by the workflow engine, enabling users to move tasks through the different phases of their lifecycle until they reach a Completed state. The User Tasks subsystem defines a default lifecycle for usertasks `kogito` and also supports `custom` user defined lifecycles.

What’s new?

In BAMOE 9.3.1, we have introduced a new lifecycle for usertasks called Web Services - Human Task (WS-HumanTask) Lifecycle based on the Web Services - Human Task Specification 1.1 (see here). The state diagram for human tasks below shows the different states and the transitions between them.

Processing of Human Task

Upon creation, a task goes into its initial state Created. Task creation succeeds irrespective of whether the people assignment returns a set of values or an empty set.

If potential owners were not assigned automatically during task creation then they must be assigned explicitly using nomination, which is performed by the task’s business administrator. The result of evaluating potential owners removes the excluded owners from results. The task remains in the state Created until it is activated and has potential owners.

When the task has a single potential owner, it transitions into the Reserved state, indicating that it is assigned to a single actual owner. Otherwise (i.e., when it has multiple potential owners), it transitions into the Ready state, indicating that it can be claimed by one of its potential owners. Once a potential owner claims the task, it transitions into the Reserved state, making that potential owner the actual owner.

Once work is started on a task that is in state Ready or Reserved, it goes into the InProgress state, indicating that it is being worked on – if the transition is from Ready, the user starting the work becomes its actual owner.

On successful completion of the work, the task transitions into the Completed final state. On unsuccessful completion of the work, the task transitions into the Failed final state.

The current actual owner of a human task can release a task to again make it available for all potential owners. A task can be released from active states that have an actual owner (Reserved, InProgress), transitioning it into the Ready state. Business data associated with the task (intermediate result data, ad-hoc attachments and comments) is kept.

A task that is currently InProgress can be stopped by the actual owner, transitioning it into state Reserved. Business data associated with the task as well as its actual owner is kept.

Task’s potential owners, actual owner or business administrator can delegate a task to another user, making that user the actual owner of the task, and also adding them to the list of potential owners in case they are not, yet. A task can be delegated when it is in an active state (Ready, Reserved, InProgress), and transitions the task into the Reserved state. Business data associated with the task is kept.

Similarly, task’s potential owners, actual owner or business administrator can forward an active task to another person or a set of people, replacing himself by those people in the list of potential owners. Potential owners can only forward tasks that are in the Ready state. Forwarding is possible if the task has a set of individually assigned potential owners, not if its potential owners are assigned using one or many groups. If the task is in the Reserved or InProgress state then the task is implicitly released first, that is, the task is transitioned into the Ready state. Business data associated with the task is kept. The user performing the forward is removed from the set of potential owners of the task, and the forwardee is added to the set of potential owners.

A task can be temporarily suspended transitioning into a Suspended state where the task cannot be acted upon. The task can continue its lifecycle only when the task is resumed from Suspended state back to its previous state. Suspend and Resume transitions are allowed for tasks in states Ready, Reserved or InProgress.

A task can be skipped, if it is marked as skippable and it moves to Obsolete final state. A task can also be moved to Error or Exited final states as required.

How to enable WS-HumanTask Lifecycle?

The below configuration property can be used to enable WS-HumanTask lifecycle implementation:

kogito.usertasks.lifecycle=ws-human-task

Users have the option to choose the Usertask Lifecycle according to their convenience. The default usertask lifecyle (kogito), the new WS-HumanTask lifecycle (ws-human-task) or even a custom user defined usertask lifecycle implementation. By default, `kogito` will be selected as the default usertask lifecycle implementation unless specified otherwise.

0 comments
39 views

Permalink