Workflow definition
A workflow definition describes the activities and resources required to accomplish a business process.
It consists of a directed graph, with a series of process activities or tasks connected together by a series of routes, which define the sequence in which the tasks are executed.
A workflow definition can be configured through the following tabs:
General tab
The General tab allows you to configure general information about the workflow definition.
From the General tab, set up the following fields:
Field |
Required |
Description |
---|---|---|
Name |
Yes |
The workflow definition name. |
Description |
No |
Hold a human-readable description or comment. |
Time out in seconds |
No |
The timeout in seconds, after which the workflow will be marked as No timeouts if set to 0. |
Max concurrent workflows |
No |
An integer that provides an upper bound on how many workflows may run in parallel. No limit if set to 0. |
Error Handling tab
Any workflow can encounter runtime errors. Errors can arise because of workflow definition issues, task failures or because of transient issues, such as network partition events.
When a workflow reports an error, the default course of action is to fail the whole workflow.
When a workflow has an error handling defined, the selected workflow definition will be run on the current workflow failure. This is useful for cleanup or post actions on failure.
From the Error Handling tab, set up the following fields:
Field |
Required |
Description |
---|---|---|
Workflow definition |
No |
The workflow definition to be run on current workflow failure. |
Workflow definition version |
No |
The specific version of the workflow definition. |
The failure workflow gets the original failed workflow's input, along with the following additional items:
-
swf:failureWorkflow
-
swf:workflowId
-
swf:workflowStatus
-
swf:workflowDefinitionId
-
swf:workflowDefinitionVersion
-
swf:taskId
-
swf:taskStatus
-
swf:cause
-
Versions tab
Workflow definition versioning is the ability to manage different versions of a workflow definition. This allows you to make changes to a workflow definition without affecting the existing version of the workflow definition.
A version is a numbered, immutable snapshot of a workflow definition. You publish versions from the most recent revision made to that workflow definition.
To start using workflow definition versions, you must publish the first version. After you publish a version, you can start the workflow definition with the version number. You can't edit a version, but you can update a workflow definition and publish a new version.
Version numbers start at 1 and increase monotonically for each new version.
When a new version of the workflow definition is published, the changes are not applied to the running or scheduled workflows. Any currently running or scheduled workflow continues using the workflow definition version that was available when the workflow started.
Tasks
Tasks represent specific business or system activities. Activities can be performed by an individual user, or by an automated application.
There are several types of tasks:
Type |
Description |
|
---|---|---|
An activity to be processed by a participant, or by an automated application using SimWorkflow API. |
||
A system activity to integrate with 3rd party applications via HTTPS. |
||
A system activity to parse and manipulate JSON objects. |
||
A system activity to use SimWorkflow to send email on your behalf. |
||
A system activity to delay the process from continuing for a specified time. |
||
A system activity to help organize complex workflows by breaking them into more manageable pieces. |
||
A system activity to terminate the process. |
Routes
Routes define the order of execution for a series of tasks based on specific rules (using workflow and/or task input parameters).
There are three ways to incorporate routing options:
Type |
Description |
---|---|
Single (linear) |
Single routing describes a route in a business process where work can only continue along a single path. At most, one task in the workflow is active. There can be one or more outbound routes defined for a task, but only one task can be active at a time. |
Conditional |
Conditional routing allows you to specify a condition on a route. A condition is based on the evaluation of JavaScript expression with previous task output parameters. If an expression evaluates to true, then that route is taken. |
Parallel |
Multiple tasks can simultaneously be split out to be processed in parallel during a business process. If tasks do not depend on each other, then they can be processed in parallel. A task can have multiple outbound parallel routes, which results in multiple parallel tasks. When all parallel tasks are completed, the outbound routes from these tasks are merged together in a collector task and the business process continues from there. |
Route condition
A route condition is a JavaScript expression and may be evaluated to return a boolean value. The result of the JavaScript expression needs to be true in order for the route to be taken.
Previous task output parameters are accessible with $
identifier.
The following variables can be referenced in the expression:
Variable |
Type |
Description |
---|---|---|
|
JSON Object |
All the workflow executed tasks, including their input and output. |
|
String |
The workflow ID. |
|
String |
The workflow definition ID. |
|
String |
The workflow definition version. |
|
Integer |
The unique sequence number of the workflow for the workflow definition. |
|
String |
The task ID. |
|
String |
The task name. |
|
JSON Object |
The workflow definition variables. See Variables for more details. |
See also list of JavaScript expression functions.