This documentation supports the 3.5 version of BMC Digital Workplace. To view the latest version, select the version from the Product version menu.

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. You can build an expression with one or more response properties from activities that appeared earlier in the workflow to drive decision flows, complete forms, or send as data to another workflow activity.

Example of a single response returned to the workflow activity

Some systems send a response to BMC Digital Workplace Catalog as a single text string. For example, the Flexera connector activity Is Flexera License Needed expects a response from the Flexera App Portal that contains a value of either 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 Digital Workplace Catalog in a structure that maps to predefined variables that are expected by the activity. For example, the Remedy connector activity Get Remedy Work Order by Id expects a response from a Remedy 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 either 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. 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.
  2. While editing a workflow, insert an activity that receives a single value.

    For example, insert the activity Is Flexera License Needed.

  3. 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, to insert  the External Service ID property into the expression as shown in the following illustration.

  4. After the activity Is Flexera License Needed, 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.

  5. 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.

  6. Draw sequence flows to connect the elements together.

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

  8. Click the gray plus sign beside 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 Digital Workplace Catalog in a structure that the activity is not prepared extract into predefined variables. For example, the Remedy connector activity Get Entry receives a response from a Remedy 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 the custom property variable can be used in an expression.

When you select an activity, add select its Output > Custom Property, the output  values is 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 a Remedy 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 Remedy connector activity Get Entry 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 variable RequestedPersonID, to receive a Person ID value to search.

    For example, to create the variable RequestedPersonID, 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

    Note

    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.

    Note

    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 an Send In App Notification activity onto the workflow, and click to open the expression builder.

    Enter the following properties:

    • Receiver—Enter the text "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 the text "Requested person info: " + and then click the gray plus sign to insert and concatenate the RequestedPersonID property.

      The following illustration shows the content of this expression:

    • 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:

  14. 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 the RequestedPersonID variable from the user.

Where to go from here

Creating service questionnaires


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

Comments