Space banner

 

This documentation supports the 20.02 version of BMC Digital Workplace Advanced.

To view the latest version, select the version from the Product Version menu.

Using Set Service Request Status in a workflow

Notify a user at critical points during a process by updating the status that appears in the user's activity timeline. You can use the Set Service Request Status element to inform the user of the progress of a process until the request is completed.

The following illustration shows a workflow that sets the service request status before calling a request approval process, and then sets a custom message based on the result of the approval request. You can follow these steps to use Set Service Request Status at any point in a workflow.

Example where Set Service Request Status is embedded in a request approval workflow

Before you begin

To set the status before sending the request for approval

  1. From the Service Broker section in the palette, drag Set Service Request Status (1) onto the canvas in front of the Call Request Approval process (2).
  2. Change the label to Set Service Status 1, or another label that you prefer, and then press Tab or click another field to save the change.
  3. Open the expression builder and click Next > after populating each of the following fields:

    ParameterValueNotes
    Request Id

    Service Request ID

    Expand the service broker context variable.
    Status"WAITING_FOR_APPROVAL"The request status will display "Waiting Approval".
    Sub Status(Leave blank)Not used.
    Status Reason(Optional) "Sending request for approval."Custom text string to show the user.
  4. Click OK to save the parameters.

To set the status when the request is approved

  1. From the Service Broker section in the palette, drag Set Service Request Status (4) onto the canvas after the Call Request Approval process (2) .
  2. Change the label to Set Service Status 2, or another label that you prefer, and then press Tab or click another field to save the change.
  3. Open the expression builder and click Next > after populating each of the following fields:

    ParameterValueNotes
    Request Id

    Service Request ID


    Expand the service broker context variable.
    Status"APPROVED"The request status will display "Approved", in addition to the default approval label.
    Sub Status(Leave blank)Not used.
    Status Reason(Optional) "Your request was approved."Custom text string to show the user.
  4. Click OK to save the parameters.
  5. Connect a sequence flow from the gateway (3) to Set Service Status 2 (4) .
  6. Change the label to Approved, or another label that you prefer, and then press Tab or click another field to save the change.
  7. Under Condition, open the expression builder and add the following condition that uses the result of the approval process:

     Status="Approved"

  8. Click OK to save the parameters.

To set the status when the request is rejected

  1. From the Service Broker section in the palette, drag Set Service Request Status (5) onto the canvas after the Call Request Approval process (2) .
  2. Change the label to Set Service Status 3, or another label that you prefer, and then press Tab or click another field to save the change.
  3. Open the expression builder and click Next > after populating each of the following fields:

    ParameterValueNotes
    Request Id

    Service Request ID

    Expand the service broker context variable.
    Status"REJECTED"The request status will display "Rejected", in addition to the default approval rejection label.
    Sub Status(Leave blank)Not used.
    Status Reason(Optional) "Your request was rejected."Custom text string to show the user.
  4. Click OK to save the parameters.
  5. Connect a sequence flow from the gateway (3) to Set Service Status 3 (5) .
  6. Change the label to Approved, or another label that you prefer, and then press Tab or click another field to save the change.
  7. Under Condition, open the expression builder and add the following condition that uses the result of the approval process:

     Status="Rejected"

  8. Click OK to save the parameters.

To set the status in case of an error

The request approval process could return an error; for example, if the user has not been assigned a manager. In a development or testing environment, you can display the error message in the activity timeline by updating the service request status.

  1. From the Service Broker section in the palette, drag Set Service Request Status (6) onto the canvas after the Call Request Approval process (2) .
  2. Change the label to Set Service Status 4, or another label that you prefer, and then press Tab or click another field to save the change.
  3. Open the expression builder and click Next > after populating each of the following fields:

    ParameterValueNotes
    Request Id

    Service Request ID

    Expand the service broker context variable.
    Status"SUSPENDED"The request status will show as "Fault" in the user's activity timeline.
    Sub Status(Leave blank)Not used.
    Status Reason

    (Optional) Reason

    Expand the request approval activity.

    Note: This response parameter displays the error message as a JSON text string. While it is appropriate for use in development and testing, do not display this response in a production system.

  4. Click OK to save the parameters.
  5. Connect a sequence flow from the gateway (3) to Set Service Status 3 (6) .
  6. Change the label to Error, or another label that you prefer, and then press Tab or click another field to save the change.
  7. Do not set a condition. An exclusive gateway must include one sequence flow to use as the default.

To complete the workflow so the process can be tested

At this point, the workflow is incomplete. If you were to save the workflow at this stage, the workflow would not be valid, and would be saved in a disabled state. You must complete the workflow by connecting all sequence flows to the end marker by inserting a non-blocking join.

  1. From the Gateways section in the palette, drag an Exclusive Gateway onto the canvas after the three Set Service Request Status elements.
  2. Connect a sequence flow from each Set Service Request Status element to the Exclusive Gateway.
  3. Connect a sequence flow from the Exclusive Gateway to the End.
  4. Click Save to exit the workflow.

Connect the workflow to a service to request from the end user console, and test the different request approval options.

Was this page helpful? Yes No Submitting... Thank you

Comments