Remove Objects from Workflows

There are many reasons why an object may need to be removed from a workflow. A few of the reasons for removing an object from a workflow are:

  1. It has finished going through the workflow
  2. The object needs to be amended before being put back into the workflow
  3. The object is no longer relevant for the workflow

No matter the reason for removing an object from a workflow, objects can be removed, i.e., taken out of workflows, in several different ways.

Remove Single Object

If a user wants to remove a single object from a workflow, and they have the 'Remove Items from STEP Workflow' privilege, this can be accomplished via the Remove from STEP Workflow context menu option on the object.

To do so, right-click on an object, or product, and select Remove from STEP Workflow.

Remove All Objects from a Workflow

If a user needs to remove all objects from a workflow, and they have the 'Remove Items from STEP Workflow' privilege, this is possible via the workflow context menu option Remove items from STEP Workflow.

Navigate to System Setup, right-click on the workflow that needs all items removed, and select Remove items from STEP Workflow.

Remove Objects from a State Using Bulk Updates

Should a user want to remove all objects from one state in a workflow, they can do so using Bulk Updates if they have the ability to search the STEP Workflow tab, and they have the 'Perform Bulk Update' privilege.

  1. Navigate to the Advanced Search tab and from the Search dropdown select STEP Workflow.

  1. From the two dropdown menus, select the desired workflow and then specify which state all objects are to be removed from. Click Search when finished.

  1. Click the Bulk Updates button at the bottom of the results list to display the Bulk Updates window.

  1. Click Next and on the Operations step, from the dropdown menu select Workflow > Remove items from STEP Workflow.

  1. Select the desired workflow, enter a 'Process Note' if desired, and select Finish to remove all objects from the state.

Removing Objects from the Final State

As objects by default stay in the final states of the workflow until explicitly removed, it is highly recommended to automatically take the objects out of the workflow when reaching a final state on the outer level. This can be done one of two ways: use the 'Remove object from STEP Workflow' business action or use an 'Execute JavaScript' business action. Both business actions can be used on states other than the final state, however, the information described below is the most typical scenario in which these actions are used.

Remove object from STEP Workflow Business Action

To set up the business action:

  1. Navigate to System Setup, open the STEP Workflow Designer for the desired workflow, and right-click on the outer level Final State (labeled 'End State').
  2. In the State Editor dialog, select the On Entry tab click the 'Add new Business Action' link.

  1. From the dropdown menu select 'Workflow' and the Remove object from STEP Workflow option.
  2. The Current radio button is selected by default. (If using this business action to be invoked outside of a workflow or if the current action should apply to a different workflow, select Other and specify a different workflow.)
  1. If desired, add a message to be logged in the Note field of the object State Log.

  1. Click Save and also save your changes before exiting the STEP Workflow Designer.

Execute JavaScript Business Action

If below script is entered in a business action configured 'On Entry' to the final state, once objects enter the state, they will be removed from the workflow and the supplied process note posted to the State Log if one was entered.

node.getWorkflowInstance(workflow).delete("Object automatically removed from Workflow");
  1. To add the above script to a business action, navigate to System Setup, open the STEP Workflow Designer for the desired workflow, and right-click on the outer level Final State (labeled 'End State').
  2. In the State Editor dialog, select the On Entry tab and click the 'Add new Business Action' link.

  1. Select 'Execute JavaScript' from the dropdown menu, and click on the Edit Binds button to add any necessary binds. The two variables and binds for this example workflow are: 'workflow' to Current Workflow and 'node' to Current Object.

  1. Add the following script in the JavaScript window.
node.getWorkflowInstance(workflow).delete("Object removed from workflow.");

The variable name for the Current Workflow bind is used in the script. If necessary, replace it with your own variable name.

  1. Click Save and also save your changes before exiting the STEP Workflow Designer.