Creating a Workflow
This topic describes how to create a basic workflow, which requires the following steps:
Each of the steps is described in detail below, guiding users through the creation of a simple workflow, as shown below.
You can also duplicate an existing workflow to create a new workflow that can be modified while leaving the original workflow unchanged.
Prerequisites
To create a workflow, the system must first have a place established to house the workflow as detailed in the Initial Setup for Workflows topic. On any system, this setup only needs to be completed once and is likely to have already been completed. However, if the System Setup tab does not have a folder that allows workflow children (as shown in the Step 1: Create a New Workflow section below), then this initial configuration needs to be completed before any workflows can be created.
Considerations
Steps 1 - 3, and step 5, of workflow creation must all be completed in a single session to save the workflow configuration. Therefore, take care during initial configuration to ensure that the steps can be completed and work is not lost.
Each of the items below must be true to save a workflow configuration:
-
A unique ID must be specified for the workflow.
-
There must be an Initial and a Final state on the outer level.
-
All states must be reachable (e.g., there must be at least one incoming transition for each state).
-
State IDs must be unique within the workflow.
-
All states must have an assignee, or a default assignee must be assigned to the workflow.
Step 1: Create a New Workflow
-
Right-click the folder established to house all workflows, and select Create STEP Workflow.
-
The STEP Workflow Designer will open. Additional information about the designer can be found in the STEP Workflow Designer topic. For now, enter an ID and Name for the workflow.
A 'container' has been created, to which states and transitions must be added to build the actual workflow.
Step 2: Create States in a Workflow
A state represents an assignment to be completed, whether by a human or a system. When a new workflow is created, it must have a single initial state at the outermost level, which is where any task entering the workflow will begin. In addition, a single final state must be present at the outermost level to indicate completion of the workflow. The indication of 'initial' or 'final' for a state is considered a characteristic of the state. States can also have 'parallel' or 'cluster' characteristics, which are required when workflows have parallel states and/or when a set of states should be grouped together within a workflow (comparable to a mini-workflow within the overall flow).
For this example, we will create a basic workflow using three states: an initial state, a standard state, and a final state. However, further descriptions of state characteristics, including more complex examples using parallel and cluster states can be found in the State Characteristics in Workflows topic.
-
To create the Initial State, right-click the canvas area and select 'Add', and 'Initial State' from the menu. The Initial State is the first state that any object started in the workflow is placed into.
-
In the State Editor that appears, type the desired ID and Name of the state. Make sure that Initial under Characteristics is checked, and close the dialog box.
Note: IDs can be revised as needed before the workflow is saved. However, because workflow business rules are tied to state IDs, all state IDs are locked upon saving of the workflow.
State names are editable at any time, and can also be localized, allowing users to view differing names for the same state based on locale. More information on this can be found in the Localizing Workflow State Names and Events section of the Workflows documentation.
-
Create a second state by right-clicking the canvas and selecting Add, then State.
No Characteristics need to be checked in the State Editor dialog box for states in between the Initial and Final States.
-
For the last state, right-click the canvas area and select Add, then Final State. In the State Editor box, fill in the ID and Name accordingly, and check the Final option under Characteristics. Close the dialog.
The workflow displays as pictured below.
You have now created a basic workflow with three states. However, for tasks to be able to move through the workflow, transitions must be added between the states.
Step 3: Create Transitions Between States
Transitions are needed between states in order for the workflow to be valid. Each state (with the exception of final states in the outer level) should have at least one transition to allow tasks to proceed through the workflow. States may have more than one transition, meaning there are multiple options for exiting the state. For example, users may need the option to move a task to a subsequent state in the workflow, as well as returning it to a previous state (e.g., to proceed or reject).
-
Hover over the center of the Initial State so that the cursor changes into a hand icon and a green box appears around the state. Click and drag to the center of the next desired state until a green box encircles that state.
Release the mouse click to create the transition, which is then displayed as an arrow between the states.
-
Repeat step 1, but going in the opposite direction (e.g., click the second state and drag to the first).
Now there are two transitions going in opposite directions in the workflow. This allows objects to progress forward in the workflow if approved or to be rejected and sent back to a previous state if needed.
-
Though they appear as a single arrow at this point, each transition is actually unique, which can be found by adding corners to each transition. To do this, right-click on the arrow and select Add Corner.
A green box will appear on the transition.
Click and drag the box to the right or left.
-
Repeat the above steps to add a corner to the other existing transition, and to add a new transition between the second and third states. When complete, your workflow should appear as shown below.
Step 4: Add Events to Transitions
While not strictly necessary, adding events to transitions can increase usability of workflows as the event names are displayed to the end users. When a meaningful event name is applied, it provides an indication to the user of what is occurring when they select to Submit a task in the workflow. When multiple transitions are present from a single state, it is especially useful to have events applied so that a user can choose which selection to make (e.g., Proceed vs. Reject).
Events also enable advanced workflow options, such as applying business rules and logic to specific events. More information on advanced functions is available in the Advanced Workflow Topics section of the documentation.
To add an event to a transition, follow the below steps.
-
Double-click the transition, select the Events tab in the Transition Editor dialog that appears, and then click the Add Event icon button. Name the event accordingly and click OK.
Note: Although the designer automatically replaces any space in the event name with an underscore, when the event is displayed to end users in the workbench or Web UI, the spaces are displayed.
Additional events can be added to the same transition, which can be useful when adding business rules to a workflow. However, for this simple example, we will use only one event per transition.
-
Close the Transition Editor dialog.
-
Drag event names onto the canvas to improve visibility if needed. Multiple events within the workflow may have the same name.
-
Repeat the above steps to add an event to each remaining transition, resulting in a workflow comparable to the one shown below.
You have now created a basic workflow, but to make it valid and save your work, you must specify an assignee for the workflow.
Step 5: Set Assignees
Each state in a workflow requires an assignee to be set, regardless if the state represents a human task or not. The object-in-state relation must always be assigned to a STEP user or user group. This can be done one of two ways:
-
assign an individual to each state as defined in Set Assignee for State
-
assign the same individual to the overall workflow as defined in Set an Assignee for the Workflow
If states do not have an assignee defined locally, by default they will inherit the assignee defined by the workflow.
As the primary purpose of workflows is to assign tasks to varying actors in a controlled manner, each workflow state that requires human interaction will generally have a different assignee (rather than using the workflow default). In contrast, states that represent a system action or an automated state will often use the workflow default, which can be set to an administrator user group.
Note: Users that do not have the STEP Workflow Administrator privilege will only be allowed to view tasks assigned to themselves or a group they are member of.
There are several options for setting assignees in a workflow, including to set assignee dynamically based on information on the object or previous actions taken in the workflow. For this example, the basic functions of specifying a user or group assignee are described. More advanced assignee options are described in the Assignees in Workflows topic.
Once assignees have been set, save the workflow:
Set an Assignee for a State
Specify an assignee for each state with user interaction. To set the assignee locally for a state, double-click the state, select the Assignee tab in the State Editor dialog that appears, click the Select User / Group radio button, click the ellipsis button () to open the Assignee Selection dialog, select a user or user group, click Select to close the selection dialog, then close the State Editor dialog.
When a user group is selected, all users in that group can access tasks in the state. When a specific user is selected, only that user (or a workflow administrator) can access tasks in the state. It is most common to assign states to user groups rather than to individual users so that tasks can continue to be processed even if a specific user is unavailable, for example when sick or on holiday.
When a state has an assignee, the letter 'A' with a circle around it will appear in the state:
If the assignee indicator does not appear, go to the View menu in the STEP Workflow Designer and check the View Content Indicators option.
Repeat the above actions until an assignee has been designated for each state in the workflow. Alternatively, an assignee can be set for the complete workflow. When each state has an assignee (via individual assignment or the workflow default), the workflow can be saved via the Save option on the File menu.
Set an Assignee for the Workflow
All states must have an assignee specified before you can save a workflow. Any state without an assignee explicitly specified inherits the workflow assignee. Therefore, it is often helpful to have a default assignee to ensure that the workflow can be saved. In addition, it is common to use the workflow assignee for states that are automated and/or the work occurring in the state is done by the system rather than a user since in these cases the assignee is not a meaningful designation. Typically, the default workflow assignee is an administrator user or group.
To set the default assignee for a workflow, double-click the title bar of the workflow, click the Select User / Group radio button, click the ellipsis button () to open the Assignee Selection dialog, select a user or user group, click Select to close the selection dialog, then close the State Editor dialog.
When each state has an assignee (via individual assignment or the workflow default), the workflow can be saved via the File menu Save option.
Step 6: Set Validity
Before a workflow is fully functional, it must be made valid for the object type(s) that will use it. For example, if a workflow was made specifically to review and approve packaging objects and data, it might be made valid for Each, Box, Carton, and Case.
To set validity, select the workflow from the System Setup tab, click the Validity tab, and check the appropriate object type(s). Any number of object types can be selected within the same section.
Note: Workflows can be made valid for several object types, but only types of the same 'super type.' As an example, you could make a workflow valid for the object types 'Shipping Address' and 'Main Address' of the super type 'Entities', but not also for 'Building Photo' of the super type 'Assets.'
Step 7: Set Workflow Options
The final step in creating a workflow is to set the options available on the STEP Workflow Editor tab. These settings are not required to be changed, but they govern the behavior of the workflow and should be considered as part of workflow design.
Initiate automatically - When checked, objects of the specified validity for the workflow are automatically initiated into the workflow upon creation, without any manual intervention. This option is only applicable for object types for which instances of the objects can exist in the Tree (e.g., products, classifications, assets, entities, publications, publication sections, or planned pages), not for attributes or lists of values.
This is useful for onboarding / creation workflows used to process new objects.
Listen on updates from Import - When checked, the system identifies updates on objects of the type specified by the validity of the workflow and takes action as needed. Specifically, an object can be transitioned from one state to another upon update of the object via import. This function is only available for assets, classifications, entities, and products, and requires additional configuration to enable. Complete configuration is described in the Triggering Workflow Events from Imports topic.
This is especially useful when completion of a workflow requires information from another source system. As soon as that information is received, the task can be automatically sent to the next state in the workflow.
Use executing user's write privileges - This option is related to the execution of business rules in the workflow. When checked, a user that triggers the execution of a business rule is prevented from making any changes or accessing any data in the system via the business rule that they are not normally privileged to. When not checked, business rules are run with full access.
For example, if the user is not privileged to change a certain attribute value on an object, and the business action is configured to make such a change, a privilege exception is thrown and the action is note carried out.
Important: Use caution with this option as it can prevent business rules from being carried out and/or can result in errors that the business rule must be able to handle gracefully.
Disable transitions on terminated Workspaces - When checked, it is not possible to perform transitions in terminated workspaces (e.g., the Approved workspace). Check this option to prevent a user from submitting objects while in the Approved workspace which results in an error since data cannot be modified in the Approved workspace. Business rules are often used to submit tasks to a state and workflow actions are executed from the current workspace. For example, if a user is viewing data in the Approved workspace and attempts to submit an object from a state where submission involves the use of a business action, an error is returned.
Start Condition - This option allows specifying a business condition that must be fulfilled before the workflow can start. For example, if some basic data is required to be populated prior to initiation, a condition can be set to ensure that the required data is present. If the condition is not met (e.g., does not evaluate to true), the object is not allowed to enter the workflow.
Important: If users will be working with tasks within the workbench (rather than Web UI), views and mappings should also be configured following creation of the workflow. The configuration of views and mappings enables the administrator to control user access to specific workflow states and to establish the order in which views appear to the user on the STEP Workflow navigator tab. Instructions for this configuration are available in the Views and Mappings for Workflows section of the Workflows documentation.
Duplicate an Existing Workflow
Another way to create a workflow is to duplicate an existing workflow. Some of the reasons for duplicating a workflow include the need to:
-
make changes and test a workflow that is already in use while leaving the original workflow unchanged.
-
create a new workflow similar to an existing workflow.
Duplicating a workflow copies the basic workflow structure and associated business rules.
The following elements are not duplicated and must added manually:
-
global workflow options as defined in the Set Workflow Options section above
-
workflow-specific privileges
To duplicate an existing workflow:
-
On System Setup, right-click the desired workflow and select Duplicate from the menu.
-
In the Duplicate dialog, enter an ID and a name.
Note: The 'Duplicate references' option has no impact on workflows.
-
Click the OK button.