Skip to main content

Technical workflow reference

ADITO workflows are modelled in Flowable Modeler and executed with Flowable Service. This reference covers workflow elements, variables and expressions, and the technical configuration of Flowable Service.


Model a workflow​

A workflow consists of a start event, one or more flow elements, and an end event. Create and deploy the workflow in Flowable Modeler; use the workflow-definition context to make it available in the ADITO client.

Workflow properties​

Workflow properties Figure: Workflow properties in Flowable Modeler.

PropertyDescription
Process identifierThe ID of the workflow.
NameThe name displayed in the ADITO client.
Is executableDefines whether the workflow can be executed.
Signal definitionsOptional. Defines signals that can trigger the workflow.

Events and sequence flows​

Every workflow requires a start event and an end event. Flowable Modeler adds a standard start event to new workflows. Use a Signal Start Event when the workflow must be triggered by a signal configured in ADITO.

A sequence flow connects one source element to one target element and defines the order in which the process runs.

PropertyDescription
Flow conditionOptional for standard flows and required for exclusive gateways. The expression must return a Boolean value.

Tasks​

Use a user task for work completed by a person, a service task to call an ADITO process, and a script task to run a small calculation in the workflow.

User task​

PropertyDescription
NameThe name of the task displayed to the user in the ADITO client.
AssignmentsThe user or group that receives the task.
Form propertiesFields that users complete in the ADITO client. Their values are available in jDito code.

Service task​

Service tasks use ADITO processes with the workflow variant and communicate through REST web services.

PropertyDescription
IDThe unique ID of the task.
NameThe name used to distinguish the task.
ClassThis value should already be set.
jDito processThe ADITO process that runs when the task starts. Its parameters are available in the jDito code.

Script task​

PropertyDescription
Script formatSet this value to javascript.
ScriptThe script content.
NameThe name used to distinguish the scripts.

Gateways​

Gateways split or combine routes in a workflow.

GatewayDescription
Exclusive GatewayCreates alternative paths. A workflow instance can take only one of the outgoing paths.
Parallel GatewayCreates parallel paths, for example to start multiple tasks at the same time.

Workflow variables and expressions​

Workflow variables transfer values between workflow elements and ADITO processes. They can be set in the following ways.

MethodUse it to
Process startPass values when a workflow starts by key or signal.
Service taskAdd values returned by a jDito service task.
Script taskCalculate and store a value in the workflow.
User-task formMake entered form values available to later workflow elements.

Set variables when starting a workflow​

When you start a workflow directly by key or signal, pass targetId and targetContext in addition to your own variables. These values are set automatically when a workflow starts from an ADITO context or through the Start Workflow action.

var workflowVariables = {
targetId: vars.getString("$local.uid"),
targetContext: ContextUtils.getCurrentContextId(),
myVariable: "foo"
};

workflow.startProcessByKey("SalesProjectPhaseExecution", workflowVariables);

Set variables in a service task​

Workflow variables are available in a service task as the JSON string in $local.value. Values passed to result.object() are added to the workflow variables when the service task runs.

var variables = JSON.parse(vars.get("$local.value"));
var activityId = variables.activityId;
var contactsStr = getContactsLinkString(activityId);

result.object({
contactPersons: contactsStr,
myServiceVariable: "foo"
});

Set variables in a script task​

Use execution.setVariable(variableName, value) to set a variable from a script task. This example calculates a due date.

var monthToAdd = parseInt(execution.getVariable("CareDueMonth"), 10);

if (isNaN(monthToAdd)) {
monthToAdd = 0;
}

var date = new Date();
var newDate = new Date(date.setMonth(date.getMonth() + monthToAdd));

execution.setVariable("dueDate", newDate.toISOString());

Use form values and expressions​

Values entered in a user-task form are available as workflow variables.

Workflow user task Figure: Form properties of a workflow user task.

Flowable resolves expressions with Unified Expression Language (UEL). For example, use the following flow condition when the isActive variable must be true:

${isActive == true}

Use variables:get, var, or vars when the variable might not be defined:

${variables:get(isActive) == true}
${vars:eq(isActive, true)}

Expressions can also set task properties dynamically.

Expression user task Figure: A user task with assignment and due date set by expressions.

The assignment field expects a user ID. A script task can calculate a due date and store it as a variable before the user task starts.

Show or hide form fields​

Use a visibility expression on a user-task form field to show or hide it from the values of other fields. The values are available through currentValues.<fieldId> only within a visibility expression.

${currentValues.customerSatisfaction == true}

Additional workflow elements​

Lookup component​

Use the lookup component in a user task in Flowable Modeler to provide lookup values from entities connected to WorkflowTask_entity in the workflow module.

Timer events​

Timer events, such as a boundary timer event, require an ISO 8601 duration or schedule expression. For an intermediate timer-catching event that must run from Monday to Saturday between 08:00 and 23:00, use the following Quartz cron expression:

* * 8-23 ? * 2-7 *

Configure Flowable Service​

Configure Flowable Service with environment variables. The following variables use SPRING_APPLICATION_JSON for the ADITO connection.

VariableDescriptionDefault
SPRING_APPLICATION_JSONJSON configuration with aditoUrl, aditoUser, aditoPassword, and aditoExternalUrl.See the alternative variables below.
FLOWABLE_COMMON_APP_IDM-REDIRECT-URLLogin redirect URL.https://localhost/flowable-idm
FLOWABLE_COMMON_APP_IDM-URLFlowable identity-management URL.https://localhost/flowable-idm
FLOWABLE_COMMON_APP_IDM-ADMIN_USERDefault administrator user name.admin
FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORDDefault administrator password.test
SPRING_DATASOURCE_DRIVER-CLASS-NAMEDatabase driver.Embedded H2 database
SPRING_DATASOURCE_URLDatabase URL.Embedded H2 database
SPRING_DATASOURCE_USERNAMEDatabase user name.Embedded H2 database
SPRING_DATASOURCE_PASSWORDDatabase password.Embedded H2 database

Alternatively, configure the ADITO connection with the following individual variables instead of SPRING_APPLICATION_JSON.

VariableDescriptionDefault
ADITO_URLADITO server URL.https://host.docker.internal:8443
ADITO_USERADITO authentication user.flowableIdmService
ADITO_PASSWORDADITO authentication password.HczABCxBEUKSmwQEnT8vbmkE8Bj1hcXOKSbsLWBg
ADITO_EXTERNAL_URLURL used for browser redirects.ADITO_URL
warning

Change the documented default credentials before using Flowable Service in a non-local environment.