Working with Statuses

Overview

Statuses are used to denote the outcome of a workflow step as values associated with a logical transition from one task to another. These values appear as labels on the flow connections and they represent the condition, which must be met in order to realize the transition.
By default, when no status is added, the task completes and the subsequent task is automatically started. This default value is represented as the (FINISHED) state in the status assignment menu, but does not explicitly appear on the transition as a label. Predefined values are Cancel, Done, Okay, Overdue, and Scheduled. You can also define custom status values.
If a status is specified on the connection, when that status changes to the associated value, then the workflow advances to the next task. The status change causes the current task to complete.
For example, the workflow contains two tasks, A and B, with a connection from Task A to Task B. Task B is initiated after Task A has been approved. We can represent this task flow by assigning an Approve status to the connection between Task A and Task B. The following figure shows this flow.
Status Example
Status Example

Adding Statuses

To add a new status, follow these steps:
  1. In the workflow tree, right-click the Statuses folder and select New Status.
    Alternatively, right-click on a task in the diagram editor and select the New Status option.
  2. In the New Status dialog box, enter a name for the status in the Status Name field.
  3. (Optional) Add a description for the status in the Description field.
  4. (Optional) Add localized versions of the name and description. For more information, see Text Localization.
  5. (Optional) Add custom attributes. For more information, see Custom Attributes.
  6. Click OK to save the new status definition.

Editing Statuses

To edit an existing status definition, follow these steps:
  1. In the workflow tree, open the Statuses folder and then right-click on the desired status node.
  2. Select Edit.
  3. Change the desired values in the Edit Status dialog box.
  4. Select OK to save the updated status definition.

Deleting a Status

To completely remove a status value from the template, follow these steps:
  1. Right-click on the status in the workflow tree and then select Delete.
    Alternatively, you can select the status directly in the workflow tree and press the Delete key or CTRL+X.
  2. Select Yes in the confirmation dialog box to permanently remove the selected status.

Assigning a Status

To assign a status, right-click on a connection between tasks and then select Change status. This opens a menu containing the status values defined for the workflow. If the desired status is not defined, then you can select the New status menu option to define the new status value.
The Change status menu does not appear on the pop-up menu for the connection between the start node and the first task. However, a status value can be assigned directly to a Stop node, as shown in the following figure:
Workflow with status of “success” assigned to the stop node
Tip
You can use the Selection tool (selection icon) to reposition the task figures in the diagram editor to ensure that the statuses are visible. Also, you can reposition the connection endpoints by selecting the target connection. Then, select the endpoint and drag it to the new location in the figure by releasing the mouse.
If the termination node is within a local subflow, transitions with this status are executed in the parent workflow. This means status propagation is triggered in the parent workflow via the termination node with status.
Parent Workflow
The parent workflow example containing a start node that leads to a subflow. The subflow results in a status of either Success or Failure. Each status invokes its own task in the @Process Invoker swimlane. Both tasks lead to a stop node.
Subflow Included in Parent Workflow
A subflow containing a start node that leads to a task within the @Process Invoker swimlane. If the task is successful, then the SubSuccess status leads to the Success stop node. If the task fails, then the SubFailure status leads to the Failure stop node.
If the subflow is executed more than once (for example, within a loop), it is recommended that the connection be joined into a single task before terminating.
Subflow Joined into a Task
Figure showing a swimlane containing two tasks with an alternate path between the two tasks. Both tasks are joined to a third task outside the swimlane named Wait For Status. The status for both of these connections is SubSuccess.

Local Statuses

When you define a status locally for a task, rather than globally for the entire template, SAS Workflow Studio displays the relative element path. An element path is an alternative way to refer to an object when using the object ID is not feasible. An element path contains a sequence of strings. Each string is the label of a parent or ancestor of the object except for the last label, which corresponds to the object itself.
The following example shows the global statuses Done and Cancel, which are defined for the Approval workflow. The Review Order task includes the local statuses Approve and Reject, and their element paths include the object's ancestors.
Local Status Values
Local Status Values
Last updated: March 5, 2020