The workflow extension enables the declaration of collaborative processes. The definition of a workflow is very flexible. Workflow steps are defined by simple tasks with decision options. These tasks can then be linked to become a workflow. Interactive steps of a workflow are shown in the inbox view of the assigned users or groups.
Workflow Definition
Workflows are declared as an implicit combination of workflow tasks. These tasks are linked by the decision options of a task which are referencing the following tasks. Workflow tasks are simply repository nodes such as:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
jcr:primaryType="nt:unstructured"
sling:resourceType="composum/platform/workflow/task/template"
assignee="tenant-${tenant.id}-managers"
category="[tenant,manage,user]"
dialog="composum/platform/tenant/workflow/dialog/manage/role-request"
hint="a (new) user wants to become a member or a new role"
hintAdded="The role request is now in work."
title="Role Request"
validation="com.composum.platform.tenant.workflow.tenant.ValidateRoleRequest">
<i18n
jcr:primaryType="nt:unstructured">
<de
jcr:primaryType="nt:unstructured"
hint="ein (neuer) Nutzer möchte eine Rolle zugewiesen bekommen"
hintAdded="Die Anfrage wird jetzt bearbeitet."
title="Rollenanforderung"/>
</i18n>
<data
jcr:primaryType="nt:unstructured"
tenantId="${tenant.id}"
userId="${userId}"/>
<options
jcr:primaryType="nt:unstructured">
<approve
jcr:primaryType="nt:unstructured"
formType="composum/platform/tenant/workflow/dialog/manage/role-request/approve"
hint="select the appropriate roles for the user and assign the roles by approving the request"
hintSelected="The selected roles will be assigned to the requesting user."
template="/conf/composum/workflow/managers/assign-role"
title="Assign and Approve">
<i18n
jcr:primaryType="nt:unstructured">
<de
jcr:primaryType="nt:unstructured"
hint="Auswahl der passenden Rollen für den Nutzer und Zuweisung durch Bestätigung"
hintSelected="Die gewählten Rollen werden dem anfragenden Nutzer zugeordnet."
title="Zuweisen und Genehmigen"/>
</i18n>
</approve>
<decline
jcr:primaryType="nt:unstructured"
formType="composum/platform/workflow/dialog/option-decline"
hint="decline the role request with or without a message"
hintSelected="The request will be declined."
title="Decline"
topic="composum/platform/workflow/decline">
<i18n
jcr:primaryType="nt:unstructured">
<de
jcr:primaryType="nt:unstructured"
hint="Ablehnen der Anfrage mit oder ohne Nachricht"
hintSelected="Die Anfrage wird abgelehnt."
title="Ablehnen"/>
</i18n>
</decline>
</options>
<workflow
jcr:primaryType="nt:unstructured"
sling:resourceType="composum/platform/workflow"
authorized="tenant-${tenantId}-members"
formType="composum/platform/tenant/workflow/dialog/manage/role-request/start"/>
</jcr:root>
Each task (each task template) is declaring a set of data properties, and a set of options for the task processing. A task action implementation is changing the data during task processing. A manually step (a task which needs an interaction for processing) is showing the declared dialog of the task with the options forms embedded. An assigned user finds such an active task in its inbox and can open this dialog for task processing.
If a task template contains a 'workflow' node this task is the starting point of a workflow. The dialog declared in the 'workflow' node is the initial workflow start dialog which is creating an instance of the starting task template if a user is performing a workflow start of that type.
The workflow graph is calculated from the starting task following all available options up to the final tasks or to repeating tasks. The calculated workflow can be shown rendering the starting workflow task with selector 'page':
This graph is also available for running workflow instances and showing the workflow progress with all performed task instances and the available options for continuing.
Workflow Processing
In the most cases workflows are started manually. Currently there are two workflow view components available, one embedded in the tenant management console and one as a 'Pages' main navigation tab. The functionality is in bot views the same:
- an 'inbox' is shown with a list or table of pending task which are waiting for manual processing
- you can process the selected task according to the configured options
- you can start a new workflow - all accessible workflows are listed to chose one; in the 'Pages' context the current page is preconfigured as a 'target' resource of the new workflow
- a status graph can be opened for the selected task
- a manager can cancel a workflow
Workflows can be configured very flexible. Each task declares its own dialog type, a set of data to manipulate and a set of available processing options each with its own form element which is embedded in the dialog on choosing the option.
Processing actions are declared and referenced by topic keys similar to job definitions. Each task and each option can reference such a topic. All services which are implementation the referenced topic are processed on performing the task and a chosen option.
The workflow engine supports the internationalisation implementation of Composum Pages. Each manually step can be configured for various languages.