User Task
User task represents a general activity to be processed by a participant (or a group of users), or an automated process. A user task is the most frequently used type of task in a workflow.
Many of the configuration settings for the user task apply to other types of tasks. Use the setting discussed here as a reference for configuring similar properties for other types of tasks.
A user task can be configured through the following tabs:
- General tab
- Input Parameters tab
- Task Processor tab
- Routing tab
General tab
The General tab allows you to configure general information about the task.
From the General tab, set up the following fields:
Field |
Required |
Description |
---|---|---|
Name |
Yes |
The task name, whose length MUST BE less than or equal to 80 Unicode characters, and MUST be unique within the scope of the whole workflow definition. |
Description |
No |
Hold a human-readable description or comment. |
Input Parameters tab
You can specify the parameters that can be used for a task. Parameters include data fields and attachments. You can use the parameter values to help you perform the task.
From the Input Parameters tab, set up the following fields:
Field |
Required |
Description |
---|---|---|
Input parameters |
No |
A JSON fragment of key-value pairs containing the mapping values from input or output of another task during the execution. |
In SimWorkflow, certain parameter name prefixes are reserved for specific purposes. Understanding these prefixes and syntax conventions is crucial for effective workflow design. Here's a breakdown of the reserved prefixes and syntax rules:
Reserved prefixes:
-
swf:
: Reserved for internal SimWorkflow parameters and variables. -
jsonata:
: Used for JSONata expressions, an advanced query and transformation language. -
${...}
: Represents a spread syntax, allowing an iterable (e.g., array or string) to be expanded in specific contexts. -
${swf:sequenceNumber}
: Represents the unique sequence number assigned to the workflow within the workflow definition. This sequence number is specific to the workflow definition and serves as a unique identifier for each instance of the workflow.
JSONPath expression syntax:
-
JSONPath expressions for task input and output must be enclosed within
${...}
placeholders. -
To escape a JSONPath expression, prefix it with an extra
$
character, e.g.,$${...}
. -
JSONPath expressions enable precise querying and manipulation of JSON data structures. See JSONPath for more information about JSONPath.
JSONata expression syntax:
-
JSONata expressions are prefixed with
jsonata:
within${...}
placeholders, e.g.,${jsonata:...}
. -
JSONata is a powerful transformation language used for querying and transforming JSON data. See JSONata for more information about JSONata.
Referencing workflow inputs:
- Workflow inputs are referenced using
${workflow.input}
.
Referencing task inputs and outputs:
- Task inputs and outputs are referenced using
${<TASK_NAME>.input}
and${<TASK_NAME>.output}
respectively.
Referencing task attachments:
- Task attachments are referenced using
${<TASK_NAME>.attachments}
.
Referencing workflow definition variables:
- Workflow definition variables are referenced using
${['swf:variables']}
or${['swf:variables'].${<VARIABLE_NAME>}}
.
Examples of acceptable expressions:
-
${workflow.input.title}
-
${TaskName.input.title}
-
${['Task Name'].output.title}
-
${swf:sequenceNumber}
-
${jsonata:$now()}
-
${jsonata:$merge(*.output)}
-
${['swf:variables'].cursor}
-
${['Task Name'].attachments[0].id}
Task Processor tab
To execute a user task within SimWorkflow, you have two primary options: using the SimWorkflow API task endpoint or leveraging a SimWorkflow page as a task processor. Here's a breakdown of each approach:
SimWorkflow API task endpoint:
-
With the SimWorkflow API task endpoint, you can programmatically trigger and manage tasks within your workflows.
-
This method is ideal for automated task execution, where tasks are initiated and handled without direct user intervention.
-
You can integrate the API task endpoint into your existing systems or applications to seamlessly incorporate workflow tasks into your business processes.
SimWorkflow Page as a task processor:
-
Alternatively, you can use a SimWorkflow page as a task processor, allowing individual users to interact with and complete tasks through a user-friendly interface.
-
SimWorkflow Pages are online documents that support various elements such as input forms, task lists, tables, diagrams, and more, all with real-time collaboration capabilities.
-
This approach is well-suited for scenarios where human intervention or decision-making is required to complete tasks within workflows.
-
Users can access and interact with task-related information directly within the SimWorkflow page, providing a seamless user experience for task execution.
Additionally, SimWorkflow Pages offer the flexibility to create powerful applications by combining workflow definitions and pages. For example, you can build applications like an issue tracking system using SimWorkflow's workflow definitions and pages. As a starting point, your SimWorkflow account already includes a simple Issue Management workflow definition, allowing you to kickstart your application development process.
From the Task Processor tab, set up the following fields:
Field |
Required |
Description |
---|---|---|
Select a page for task processor |
No |
Use a SimWorkflow page as a task processor. |
Routing tab
In the Routing tab, you configure how the task handles the incoming routes and how it processes the outgoing routes.
From the Routing tab, set up the following fields:
Field |
Required |
Description |
---|---|---|
Collector task |
No |
If you used parallel routing earlier, at some point, you must have a collector task to combine the parallel routes into one place. If the current task is the collector task, check the Collector task option. Otherwise, leave it unchecked. |
Take the first route that evaluates to true |
Yes |
As soon as one condition becomes true, the route is taken. |
Take all routes |
Start all routes in parallel. |