BRE Request

Use the BRE Request activity to retrieve the data from your organization's Business Rules Engine (BRE) to use in the flow. The BRE Request activity uses standard HTTP protocols to fetch data from the BRE.

The following sections enable you to configure the BRE Request activity:

General Settings

Parameter

Description

Activity Label

Enter a name for the activity.

Activity Description

(Optional) Enter a description for the activity.

Query Parameters

As part of the BRE Request, you can pass the parameters that are provided in the API call to the BRE. In the Key‐Value columns, you can enter the key for the query and the associated value to send along with the query. You can also use the double curly braces syntax to pass variable values.

The BRE activity has one predefined Query Parameter: context. This query parameter is passed in the API call to the BRE.

Note

The TenantID is automatically injected as a parameter and does not need to be configured.

Query Parameters

Parameter

Description

Context

Contains the reason for the request. This mandatory parameter can't be edited or deleted.

This parameter must contain the same value as the value specified in the Attribute context in BRE. For more information, see the "Creating a Set of Rules" section in the Cisco Webex Contact Center Business Rules Engine User Guide.

ANI

Contains the originating phone number of the call. This is a default parameter that you can edit or delete, based on the rules configuration in the BRE.

A sample value for ANI is {{NewPhoneContact.ANI}}

Response Timeout

Specifies the connection timeout for the BRE Request. Default is set at 2000 milliseconds.

Number of Retries

Specifies the number of times the BRE Request is attempted after failure.

This parameter is used if the status code is 5xx; for example, 500 or 501.

To add a query parameter, click Add New. This adds a row where you can enter the key value pairs. You can add as many query parameters as required as part of the BRE Request.

Parse Settings

This section enables you to parse the response from the BRE Request into different variables:

Parameter

Description

Response Variable

Choose a variable to which you want to extract a particular section from the BRE Request response object. You can choose only Custom Flow variables from the drop-down list.

Path Expression

Define the Path Expression for parsing the response object. Depending on the kind of data structure of the response object and the use cases for extracting a subset of that information, the Path Expression varies.

Data is normalized to an object hierarchy before Path Expression execution, so JSONPath is used in the response object regardless of the configured Content Type.

Output Variables

The BRE Request returns two output variables:

  • BRERequest1.httpResponseBody: Returns the response body for the BRE Request.

  • BRERequest1.httpStatusCode: Returns the status code of the BRE Request.

    These response codes are classified into the following categories:

    • Informational responses (100–199)

    • Successful responses (200–299)

    • Redirects (300–399)

    • Client errors (400–499)

    • Server errors (500–599)

Content Type Formats

The following examples describe sample input Content Type formats and the JSON response.

Content Type XML

Use this tool to convert XML into JSON format https://www.convertjson.com/xml-to-json.htm.

XML Input Format:

<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Test application</body>
</note>

Data/JSON Normalized Response

{
   "note": {
      "to": "Tove",
      "from": "Jani",
      "heading": "Reminder",
      "body": "Test application"
   }
}

Example JSON Path Expression: Use $.note.from to get the value as Jani.

Content Type TOML

Use this tool to convert TOML to JSON format https://www.convertjson.com/toml-to-json.htm.

TOML Input Format:

title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00

Data/JSON Normalized Response

{
   "title": "TOML Example",
   "owner": {
      "name": "Tom Preston-Werner",
      "dob": "1979-05-27T15:32:00.000Z"
   }
}

Example JSON Path Expression: Use $.owner.name to get the value as ‘Tom Preston-Werner’.

Content Type YAML

Use this tool to convert YAML to JSON format https://www.convertjson.com/yaml-to-json.htm.

YAML Input Format:

# An employee record
martin:
  name: Martin D'vloper
  job: Developer
  skill: Elite

Data/JSON Normalized Response

{
   "martin": {
      "name": "Martin D'vloper",
      "job": "Developer",
      "skill": "Elite"
   }
}

Example JSON Path Expression: Use $.martin.job to get the value Developer.

Content Type JSON

Use the JSON Expression Evaluator https://jsonpath.herokuapp.com/.

JSON Input Format:

{
   "martin": {
      "name": "Martin D'vloper",
      "job": "Developer",
      "skill": "Elite"
   }
}

Data/JSON Normalized Response

{
   "martin": {
      "name": "Martin D'vloper",
      "job": "Developer",
      "skill": "Elite"
   }
}

Example JSON Path Expression: Use $.martin.job to get the value Developer.