4953 views

Service catalog request item | Unable to start workflow

 

Problem
The Workflow Engine allows users to attach workflows to different tables within the product in order to automate their company processes and procedures. For most tables, the Table field in the Graphical Workflow Editor [wf_workflow_version.table] is the same table that the workflow is connected to.

Following this pattern, you might expect that a workflow for a specific Service Catalog item has Catalog Item [sc_cat_item] as the "Table" in the Graphical Workflow Editor; however, this is not the case. For Service Catalog Workflows, the "Table" is set to the Request Item table [sc_req_item]. Also, the Workflow field of the Catalog Item should be pointing to the desired workflow. (For more information, see Service Catalog Workflow Definition.) If you attach a workflow to the Catalog Item table, or forget to specify the workflow in the Catalog Item record, you are unable to start the workflow.
Symptoms
The symptoms below appear on the instance if a Requested Item is not attached to a workflow:
  • Under the Related Links of the Requested Item [RITM] form, when you click Show Workflow, this message appears on the screen: There are no workflow contexts for this document.
  • There are no Approvals or Catalog Tasks being generated for the Requested Item.
  • Users are not receiving approval e-mails requesting to Approve or Reject an RITM.
  • Searching for Workflow Context records by ID (reference to the RITM record) is returning no results.
  • The stage on the RITM displaying as: Waiting For Approval.

  

Cause
The main cause of this issues is the Start Workflow business rule on the Requested Item table [sc_req_item] that is not triggering. This business rule would trigger on an "Update of the RITM record". When the RITM is updated, you would check for the following:
  • Does the Catalog Item being referenced have the Workflow field populated?
  • Is the stage of the RITM displaying as request_approved on the form?
  • Does the RITM in question have no Workflow Context attached?

If the above criteria is not met, then there is no workflow attached to the RITM record.


Common customer question


A question commonly asked by customers is, "Why do we execute the Start Workflow business rule on an 'Update' rather than an 'Insert'?"

The answer is that do not want to start the Request Item workflow until the parent Request [sc_request] has gone through its approval logic. To accomplish this, we have another business rule on the parent Request table [sc_request] called "Cascade Request Approval to Request Item". This business rule would be triggered when the Approval field value changes. 

If the Cascade Request Approval to Request Item business rule triggers, the system would check whether the Stage field is "Waiting for Approval" and the Approval field is "Approved". If this is the case, we would query to the Requested Item table [sc_req_item] and change the Stage to request_approved on the RITM record.

Due to this, we would be meeting the second condition for the Start Workflow business rule to run. Since we have done an "Update" to the RITM record, the Start Workflow business rule would then execute and trigger the Workflow Context for the RITM.


Resolution

To ensure there are running workflows on the RITM:

  1. Check that the parent Request [REQ] has the Approval field set to Approved. In an base system instance, the field value for Approval would be determined by the Service Catalog Request Workflow running on the parent Request [REQ] table.
  2. Check that the Catalog Item referenced from the RITM has the Workflow field populated with a Workflow record.
  3. Check that the workflow definition has the Table field set to Request Item [sc_req_item] and not Catalog Item [sc_cat_item].

Article Information

Last Updated:2017-08-16 03:49:28
Published:2015-09-08