This documentation supports the 22.1 version of BMC Helix Digital Workplace Basic and BMC Helix Digital Workplace Advanced. Icons distinguish capabilities available only for the Advanced and External license levels. For more information, see License types and features.

Using responses from a connected system in your workflow

Some workflow activity elements move data through a workflow, while other elements send data to a connected system. Activities that send data to a connected system can also receive a response. To drive decision flows, complete forms, or send as data to another workflow activity, you can build an expression with one or more response properties from activities that appeared earlier in the workflow

Example of a single response returned to the workflow activity

Some systems send a response to BMC Helix Digital Workplace Catalog as a single text string. For example, the Is Flexera License Needed Flexera connector activity expects a response from the Flexera App Portal that contains a 1 or 0, where 1 represents True. The unnamed response is a raw value that is supplied to the Output parameter of the connector activity.

The following illustration shows the portion of a workflow where an exclusive gateway that redirects the sequence flow based on a condition that tests the value the returned response from the Is Flexera License Needed activity.

Example of a response with multiple values in an expected structure

Some systems send a response to BMC Helix Digital Workplace Catalog in a structure that maps to predefined variables that the activity expects. For example, the Get Work Order by Id Helix ITSM connector activity expects a response from a BMC Helix ITSM system that contains a defined structure.

The following illustration shows an example of an expression that inserts the Summary variable from the list in the Available Values column.

Before you begin

Capture process information and pass it into the workflow.

To use a single response variable in an expression

When the structure of a response is a single value or a predefined variable structure, you can build expressions with variables that you insert from the Available Values column. When the workflow runs, the variables are replaced by the values from the response.

The following example shows multiple ways of inserting a single variable into the expression builder at various points in the workflow. The end result is an incomplete workflow that demonstrates only the the decision flow portion that is based on a conditional expression.

  1. Log in to the Catalog console and open the workflow designer.
  2. Create a service broker context variable to populate one of the input fields (variable name: sbcontext). See Adding a process context variable to a workflow.
  3. While editing a workflow, insert an activity that receives a single value.

    For example, insert the Is Flexera License Needed activity.

  4. With the activity highlighted, open the expression builder to populate the following parameters:

    • Connection ID—Insert the Connection Id property.
    • Service—Expand to find and insert the service broker context property sbcontext > Service > External Service ID.

    For each parameter, click the gray plus sign to add the property parameter. For example, you can insert  the External Service ID property into the expression as shown in the following illustration:

  5. After the Is Flexera License Needed activity, insert an exclusive gateway:

    Before you can build a conditional expression to direct the sequence flow, you must add two activities to use as choices.

  6. Add the following activities as examples to demonstrate the decision flow.

    • From the Flexera group, add Check Flexera Available Licenses.
    • From the Expressions group, add Compute Value.

    You can replace these activities to meet your specific use cases later.

  7. Draw sequence flows to connect the elements.

  8. Click the sequence flow to the Check Flexera Available Licenses activity, and click the link to open the expression builder.

  9. Click the gray plus sign next to Output to insert the property into the expression, and type = 1 to set the condition.

    You have just created a workflow decision flow that checks for one condition, as shown in the following illustration.

    An exclusive gateway can evaluate any number of conditional expressions, as long as one of the sequence flows is set without a condition for use as the default. For more information, see Control of workflow with gateways.

Example of a response with multiple values returned in a dynamic structure

Some systems send a response to BMC Helix Digital Workplace Catalog in a structure that the activity is not prepared to extract into predefined variables. For example, the Helix ITSM connector activity Get Entry receives a response from the BMC Helix ITSM system that contains a JSON description of the response. The connector activity cannot separate the response into predefined variables. However, if you know the structure of the response, you can assign specific properties of the response to variables that you define.

The following illustration shows an example of how you can use the custom property variable in an expression.

When you select an activity, select its Output > Custom Property. The output values are displayed in JSON format in the Expression Builder.

To create custom variables from a response with a dynamic structure 

The following example shows how you can build a complete workflow that queries the BMC Helix ITSM system for data, and sends a dashboard notification with custom variables that have been mapped to specific response properties.

  1. Verify the data structure of the response object to expect.

    This example uses the Get Entry Helix ITSM connector activity to query the CTM:People records for information about a specific user record. The following code shows the JSON structure of a CTM:People record that shows the properties with sample values. The specific data structure you receive will be different if you are querying against a different form or connecting to a different system.

    Response from a CTM:People record represented as a JSON string
  2. From the properties pane of a new workflow, click Add/Remove Variables.
  3. Click Add Variable and create a RequestedPersonID variable to receive a Person ID value to search.

    For example, to create the RequestedPersonID variable, set the following properties:

    • Name—Enter any text, such as RequestedPersonID.
    • Input/Output Parameter—Select Input and Input Required.
    • Data Type—Select Text.


    The RequestedPersonID variable will contain a Person ID value that a user will submit at the time of the request.

  4. Click Save.
  5. Insert a Get Entry activity onto the workflow, and click the link to open the expression builder.

    Enter the following properties:

    • Connection Id—Click the gray plus sign to insert the Connection Id property.
    • Form Name—Enter "CTM:People" in double quotation marks to specify the form to query against.
    • Request Id—Click the gray plus sign to insert the RequestedPersonID variable as the value to search.

    Create output parameters to map to the following properties from the JSON representation in Step 1.

    Output parameter nameResponse property keyExample property value (see the JSON representation)
    Site NameSiteHeadquarters, Building 1.31
    Cost CenterCost Center Code11111-1111

    Important

    Name and Response property key values must be different for a single output parameter.

  6. In the Properties pane, under Output Map, click Add to create an output parameter.

  7. Enter Site Name, and then press Enter to save the name.

  8. Click the link to open the expression builder to specify the source for the Site Name output parameter.

  9. Expand the Get Entry > Output property, and click the gray plus sign beside Custom Property to insert an activityResults property string, as in the following illustration.

  10. Inside the activityResults string, replace the word "custom" with the name of the response property to insert; for example: Site.

    Important

    When you attach the response property key to the output parameters that you create, you must enter the property name in the activityResults string exactly as the desired property key in the response; otherwise, the source of the output parameter will be empty.

  11. Click OK to save this output parameter mapping.
  12. Repeat steps 6 through 11 to create an output parameter named Cost Center, and specify the source as the response property: Cost Center Code (as shown in the following illustration):

  13. Insert a Send In App Notification activity onto the workflow, and open the expression builder.



  14. Enter the following properties:

    • Receiver—Enter "hannah_admin" or the user name of another catalog administrator in double quotation marks to specify the user who will receive the dashboard notification.

    • Title—Enter "Requested person info: " + and then click the gray plus sign to insert and concatenate the RequestedPersonID property.
    • Content—Concatenate the text and output parameters together to build the expression "Site: " + Site Name + " - Cost Center: " + Cost Center.
      The following illustration shows the content of this expression:



  15. Complete the workflow by drawing sequence flows to join the elements, as shown in the following illustration.

    When you can attach this workflow to a service, you must create a questionnaire that receives a value for the RequestedPersonID variable from the user.

Where to go from here

Creating service questionnaires


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

Comments