Workflow editor at a glance
The workflow editor interface consists of the following elements:
![workflow editor at a glance](_images/workflow-editor-at-a-glance.png)
The workflow editor interface consists of the following elements:
Task
A task is an activity executed by a script or a user.
Script task
A script task is used when you want the system to execute a server script. This could be used, for example, to process an input from the workflow context and store the output as a variable. In the component properties pane, you define the following properties for a server script:
- Name
-
Name of the script task.
- Description
-
Description of the script task.
- Server script
-
Server script that is stored in the system and that is executed during the workflow.
// Get Data from Workflow, object number/type, value, currency etc.
log.info(JSON.stringify(wfData));
// Set processing true/false - Use 'True' or 'False'.
wfData.result = 'False';
complete();
Remember you can right-click → Code Snippets in the Script Editor to find more information around the code available to utilise within scripts, when the script is used in a Script Task.
User task
A user task is used when you want a user of your system to execute a certain activity. This could be used, for example, to approve an order or invoice.
- Name
-
Name of the user task.
- Description
-
Description of the user task.
- Max Processing time
-
This property is not implemented. - Inbox Application
-
Application where the user receives notifications to perform a task. Default is the
Universal Inbox
widget in the launchpad. - Approver Determination
-
Select the approver for the user task.
- Task Action
-
Selection of the task action for the user task.
- Custom Script Determination
-
It runs a script in the background that can be used to add approvers with custom logic. E.g.
The script will receive the following data.
wfData = { id: runtime.id, objectKey: runtime.objectKey, objectType: runtime.objectType, amount: runtime.amount, currency: runtime.currency, approvers: "Array of approvers from other determination" } // In the script you can dynamically add more approvers. wfData.approvers.push("approverUsername"); // or by adding a role or group id. wfData.approvers.push({orgId: 'role or group id'})
When the script has executed approvers added to the approvers array will be included in the workflow runtime.
- Enable Forward
-
Allow the approver to forward the task. See here for more information.
- Enable Query
-
Allow the approver to send a query. See here for more information.
- Enable Notification
-
If selected you must also select an email template. An email is sent to approvers when assigned a workflow/user task. You can pipe the following variables in the email template with {=variableName}
{ name: user.name, title: wfDef.title, subTitle: wfDef.subTitle, taskName: task.title, taskDescription: task.subTitle, objectKey: wfRuntime.objectKey, objectType: wfRuntime.objectType, amount: wfRuntime.amount, currency: wfRuntime.currency, }
- Task Notification
-
Select the notification which need to be sent with the user task.
- Sender eMail
-
Email address from which the user task is sent.
User action
Actions for a user to perform during a script task or a user task.
- Approve
-
The user approves the task.
- Reject
-
The user rejects the task.
- Save
-
The user saves the state of the workflow. The "save" node behaves the same as the accept/reject nodes. If it is present following a user task, an additional button with the label you specify in the task is rendered in the wf inbox app.
Within the Universal Workflow Inbox, only action buttons for the User Actions that are connected to the User Task will be visible for the user to select. EG: If only the Approve node is connected to the User Task, only the Approve button will be visible within the Workflow Inbox. |
Each user action can then connect to a different script task to perform associated logic. |
Script action
Result for a server script during a script task.
- False
-
If the server script fails.
- True
-
If the server script succeeds.
Event
Events to mark the end of a workflow.
- Cancel
-
Event to cancel the workflow if it has failed.
- Complete
-
Event to complete and close the workflow if it has succeeded.