Expose Decisions as Services

You must add at least one decision service to your decision before you can use it in processes. Decision services expose one or more output decisions of your decision model as public REST APIs. A decision service consists of a set of input data and a set of output decisions from the containing decision model.

Configure a decision service

  1. On the top of the decision editor, click Decision Service Decision Service icon to open the Services pane. Optionally, you can click the Decision Service icon from the right sidebar menu of the decision editor.

    Note that the number within brackets besides the Decision Service icon, indicates the number of services created for the decision.

  2. In the Services pane, click Add new service Add new service icon to open the Add Decision Service pane.
  3. Enter a name for the decision service and click OK. The new service appears in the pane with two fields: Output Decisions and Input Data.
  4. Click the Output Decisions field to select the output decision you want to expose through the service.
  5. Click the Input Data field to select the input data to expose through the service.

Note:

You can add multiple values for the input data and the output decision.

Get the REST API endpoint URL, the request payload, and the response payload of the decision model

Once a decision service is set up, you can note down the REST API endpoint URL, the request payload, and the response payload of the decision model to call a decision service.

  1. In the decision editor, click Decision Service Decision service icon to display the Services pane.
  2. Click Options next to the service name, and then click Payload.
  3. In the Service Payload pane that displays:
    1. Click URL and then click Copy Copy icon to note down the decision service REST API endpoint URL.

      The following is an example of a decision service endpoint URL:
      https://<<base_url>/decision/api/v1/decision-models/<application_name>/versions/<application_version>/active/definition/decision-services/<decision_service_name>
      Where:
      • base_url: base URL of your Process Automation instance
      • application_name: the name of your process application (in case of local decision) or the name of your decision application (in case of external decision)
      • application_version: the version of your process application or decision application
      • decision_service_name: the name of your decision service
    2. Click Request Payload and then click Copy Copy icon to note down the request payload JSON schema.

      The JSON schema of the request payload provides the format in which you provide the input data to the decision service.

    3. Click Response Payload and then click Copy Copy icon to note down the response payload JSON schema.

      The JSON schema of the response payload provides the format in which the decision service provides the output data.