Information
This documentation supports the 21.3 version of BMC Helix Digital Workplace Advanced.To view an earlier version, select the version from the Product version menu.

Implementing the Activity Service Provider Interface


Success

Tip

Click here to download the JSON (JavaScript Object Notation) snippets included in these topics, and customize them to use according to your requirements.

The Activity SPI is a subset of the remote connector SPIs that a connector can implement to support business features of BMC Helix Digital Workplace Catalog beside the initial handshakes (descriptors, health checks) and actions (because each action is, in a way, specific to its connector).

External Activities

Capability:

 com.bmc.dsm.catalog:activityProvider

The activity SPI enables BMC Helix Digital Workplace Catalog to track and act on long-running external activities that are executed outside of it. Examples of activities are software installations or external tickets like SRM requests. The duration of such external activities can span from seconds to weeks. Note that if an action is systematically short a few seconds, then it may be simpler to have the corresponding workflow action wait for its completion. The activity SPI is meant for cases, where blocking the fulfillment is not acceptable.


Here is a typical high-level scenario:

  • A remote connector indicates that it is an activity provider.
  • A remote connector indicates, via its action descriptor, that one of its actions can generate activities.
  • The action is leveraged within the fulfillment workflow of a published service.
  • An end-user requests this service and the workflow executes.
  • BMC Helix Digital Workplace Catalog look at the execution and figures out that an activity has been launched.
  • BMC Helix Digital Workplace Catalog fetches more information about the activity from the connector (through the Activity SPI). The connector returns the information and the activity now appears in the Service Requests report in the administration UI of BMC Helix Digital Workplace Catalog. The status of the activity is factored in the calculation of the BMC Helix Digital Workplace Catalog request status.
  • BMC Helix Digital Workplace Catalog regularly polls the status of the activity and updates the request status until the request is done.


The Action Descriptor

In order to leverage this activity capability, a connector has to provide extra information about the actions that will trigger external activities.

Note that this extra information is also leveraged by BMC Helix Digital Workplace Catalog when generating workflows during service imports.

{
 "connectors": [
    {
      ...
     "actions": [
        {
         "name": "submitOrder",
         "displayName": "Submit Order",
         "path": "order_product",
         "inputs": [ ... ],
         "outputs": [
{"name": "orderId", "type": "Object"},
// Referenced in the "action output captures" below.
{"name": "orderNumber", "type": "Object"}
// Referenced in the "action output captures" below.
 ],
         "com.bmc.dsm.catalog": {
 // An optional section

"externalActivityFactory": true,
// Indicates that "submitOrder" may trigger external activities
"externalActivityType": "com.example.Order",
// Specifies a name for the type of activity triggered by this action.
// Although it could be displayed to administrators, this name is a natural key for the activity type.
"actionOutputCaptures": [
// Provides additional information about some of the output fields, so that the application is able
// to capture some identifying information about triggered activities.
 {
"expression": "orderId",
// A workflow expression that references a property of an output field.
// Use the null value, to indicate that the whole output is the value.
"outputAssignment": "EXTERNAL_ACTIVITY_ID"
// Indicates what property of the activity the expression above references.
// Possible values for this use case:
// EXTERNAL_ACTIVITY_ID: ID of the external activity
// EXTERNAL_ACTIVITY_DISPLAY_ID: display ID of the external activity (typically displayed to agents and administrators)
 },
  {
"expression": "orderNumber",
"outputAssignment": "EXTERNAL_ACTIVITY_DISPLAY_ID"
  }
 ]
  }
},
        ...
      ]
    },
    ...
  ]
}


Activity SPI



 

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

BMC Helix Digital Workplace Advanced 21.3