Phased rollout This version of the software is currently available only to early adopter SaaS customers as the first step in our phased rollout.

Workflow to request approval


Catalog administrators can create workflows that use approval processes defined in Action Request System (AR System) Approval Server.

At any point in a workflow, you can insert a Call Activity that calls for an approval process that is linked to the SB:ServiceRequestStub form, and direct the sequence flow based on the response from the Approval  Server. You can call for the default SB Request Manager Approval process or a custom approval process. For more details about custom approval services, see Calling-external-workflows.


Related topics

Calling-external-workflows

From the Action Request System (AR System) documentation:Setting up the approval process

Before you begin

Create the following process variables:

To insert a request for approval

A request for approval action requires a Call Activity element to call an external process named Request Approval. The called Request Approval process is hidden from the list on the Workflows page to prevent unintentional edits.

  1. From the palette, drag a Call Activity element onto the canvas.

    workflow-activities-palette-markup.png


    Warning

    Do not use the Create Request Approval Stub Entry element to generate approval requests. This element is used inside the Request Approval process that the workflow calls.

  2. Enter a descriptive name for the Label.
    The name must be unique from all the other elements in the same workflow, for example, Call Request Approval.
  3. In the Properties panel, expand Called Process.
  4. Search for the built-in process named Request Approval, and verify that All Processes > MyITSB-Approval > Request Approval appears, as shown in the following illustration:
    call-activity-myit-sb-request-approval.png
  5. Click Request Approval to select the process.
  6. Click Call Activity, and submit all required input parameters for the Request Approval called process.
    CallActivity.png
    1. Click Click to build an expression to open the expression builder for any of the available parameters. 
    2. Expand the process context process variable (identified as requestInfo) to insert the specified variables into each parameter, as shown in the following table.

      Parameter

      Required

      Example

      Comments

      Requesting For User ID

      Required

      LOGIN NAME

      Use the following parameter from the process context variable: Process Variables > context > Requested For User > Login Name

      Approval Summary

      Required

      "Request for "+SERVICE NAME+ "by "+FULL NAME

      The Approval Summary field appears in the request for approval notification in BMC Helix Digital Workplace. Create a descriptive summary by adding helpful parameters and text in this field.

      Example:

      To send text that includes the service name and the requestor's full name, use the following parameters from the process context variable:


        • Process Variables > context > Service > Service Name
        • Process Variables > context > Requested For User > Full Name

      Concatenate the text to complete the following expression: "Request for "+SERVICE NAME+ "by "+FULL NAME

      Service Name

      Required

      SERVICE NAME

      Use the following parameter from the process context variable: Process Variables > context > Service > Service Name

      SB Service Request ID

      Required

      SERVICE REQUEST ID

      Use the following parameter from the process context variable: Process Variables > context > Service Request > Service Request ID

      Requesting User ID

      Optional

      LOGIN NAME

      Use the following parameter from the process context variable: Process Variables > context > Requested By User > Login Name

      Service ID

      Optional

      SERVICE ID

      Use the following parameter from the process context variable: Process Variables > context > Service > Service ID

      Approval Process Name

      Optional

      "SB Request Manager Approval"

      If the Approval Process Name is blank, the action will call the default SB Request Manager Approval process in the Approval Server.

      If the Approval Process Name is specified, the action will attempt to call a process of the same name in the Approval Server. For information about calling a custom request for approval, see Calling-a-custom-approval-process.

      Process Name

      Optional

      None

      Leave blank.

      Process Instance ID

      Optional

      None

      Leave blank.

      Order ID

      Optional

      ORDER ID

      Use the following parameter from the process context variable: Process Variables > context > Service > Order ID

      Reject Reason

      Optional

      None

      Use the Receive Task element to suspend the workflow until the external system sends a response back to BMC Helix Digital Workplace Catalog. The Receive Task  element waits for the response in the form of a Signal Parameter. For more information, see Responses returned from the request for approvalbelow.


      Approval Status

      Optional

      None

    3. (Optional) To send user input to the called custom approval process, populate one or more of the following flexible input fields with your process input variables:

      Input parameter name

      Input variable data type

      Flex_Char_01

      Text

      Flex_Char_02

      Text

      Flex_Char_03

      Text

      Flex_Char_04

      Text

      Flex_Char_05

      Text

      Flex_Char_06

      Text

      Flex_Char_07

      Text

      Flex_Char_08

      Text

      Flex_Char_09

      Text

      Flex_Char_10

      Text

      Flex_Int_01

      Integer

      Flex_Int_02

      Integer

      Flex_Dec_01

      Decimal

      Flex_Dec_02

      Decimal

      Flex_DateTime_01

      Date/Time

      Flex_DateTime_02

      Date/Time

      Flex_Date_01

      Date

      Flex_Date_02

      Date

      Flex_Time_01

      Time

      Flex_Time_02

      Time

      Tip

      To populate the Flex fields with user input, create the required process variables. For more details about process variables, see Data-handling-in-workflow-activities.

      To pass text input from the service requester, create a text process input variable. For more details about process input variables, see Adding-process-input-variables-to-a-workflow.

      To pass date and time information, create date and time process input variables. To pass the current UTC time of the server, you can use one of the available general variables: the Current DateCurrent TimeCurrent Date and Time.

      When you have created a workflow, create a questionnaire, and map the process input variables that you have used to populate the Flex fields with the process questions. For more details about process questions, see Exploring-the-workflow-designer.

      Click here to view the JSON of the example workflow

      Failed to execute the [code] macro. Cause: [RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)]. Click on this message for details.

      By populating any of the flexible fields, you send the information from BMC Helix Digital Workplace Catalog to the fields that are available on the Flexible Fields tab of the SB:ServiceRequestStub form:

      FlexibleFields1.png
      The information that you send to the SB:ServiceRequestStub form is saved on the Flexible Fields tab, and can be used for creating approval rules. 
      FlexibleFields2.png

  7. Click Save to close the expression builder.

    When fulfilling a service, the inserted Call Request Approval activity send a request to run a process on the Approval Server.

Important

The Request Approval process times out after two months if no action is taken on the process at runtime.  

To verify the request for the approval process

A quick way to verify that the approval system is configured correctly is to route an output from a Call Request Approval process into an in-app notification, as shown in the following illustration:

workflow-request-approval-testing.png

The in-app notification appears on the dashboard of the administrative user you specify as the receiver.

To connect an in-app notification

  1. From the palette, drag a Send In App Notification element onto the canvas.
  2. Open the expression builder, complete a field, and click Next > to advance to the next field.

    Parameter

    Example with comments

    Receiver

    "hannah_admin"

    Manually enter the user name (without the @domain extension) of the administrator who should receive the notification.

    Title

    requestInfo > Service > Service Name + "approval process testing"

    Expand and click to insert the process variable Service Name, and then manually concatenate the additional text.

    Content

    Activities > Call Request Approval > Status + " " + Activities > Call Request Approval > Reason

    Expand and click to insert the Status and Reason signal parameters, and then manually concatenate the space between the parameters.

  3. Click Save to close the expression builder.
    The workflow is defined to send the Status and Reason returned from the approval process to the administrator's dashboard upon completion.

    Tip

    To test that the workflow itself is being called, you can also insert a Send In App Notification element before Call Request Approval, for example:

    workflow-activities-send-in-app-before-after.png


To verify this workflow in a service

  1. Attach this workflow to a service in the Service Options panel.
  2. Complete the rest of the service publishing and entitlement process to view the service in BMC Helix Digital Workplace.
  3. Open BMC Helix Digital Workplace as a user and request the service.
    The service should appear in your requests.
  4. In a separate browser session, open BMC Helix Digital Workplace and log in as the user's manager.
    The service request should appear in the manager's updates list.
  5. Approve the service request, or reject it, and provide a reason.
  6. Open the BMC Helix Digital Workplace Catalog dashboard while logged in as the user specified in Send In App Notification.
Note

When the approval process is completed, this workflow will always generate a dashboard notification, even in the event of system errors. The most common error is that the user who requested the service has not been assigned a manager.

To incorporate a request for approval in a workflow

When you have confirmed that the approval configuration is correct, and it sends the appropriate notifications, you can incorporate the element into a workflow by using exclusive gateways.

request-approval-process-markup.png


Responses returned from the request for approval

You can expand the called Request Approval process to view its steps. As a service catalog administrator or internal service supplier, consider the following steps:

  • The Create Approval Stub Entry (form SB:ServiceRequestStub) is created.
  • The Receive Task element returns a Work Status.

workflow-request-approval-expanded.png


Action

Description

Create Approval Stub Entry

Creates a record through the SB:ServiceRequestStub form on the Action Request System (AR System) server that triggers an Approval Server process.

If the process fails to create a record, the workflow exits with a failure message.

Receive Task

Waits for the response and then exits with the following message variables, called Signal Parameters:

  • Request Status
  • Reject Reason

Values returned when running the default approval process

The approval rules and messages returned upon the receipt of signatures is configured in the process named SB Request Manager Approval in the Approval Server.

The Request Status signal parameter returns one of the following values:

Response

Description

Approved

The manager approved the request.

Rejected

The manager rejected the request. The manager may or may not have supplied a Reject Reason.

Error

The request approval process failed. The system error message is supplied as the Reject Reason.

Failed

The request approval process timed out because two months elapsed since the request date.

You can test for these returned values, and insert exclusive gateways to direct the sequence flow based on conditions.

To troubleshoot issues

If the workflow triggers a Fault error in BMC Helix Digital Workplace, check the configuration. Most common configuration issues include:

Required licensing

SaaS subscribers who use BMC Helix ITSM or BMC-Helix-Virtual-Agent-Basic-service are entitled to this feature.

Where to go from here

Calling-a-custom-approval-process

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*