Configure a Business Event Rule

Purpose

The purpose of this guide is to create a business event rule for a specific use case. A use case for a business event rule can be configured on both the UI and through APIs. Here APIs are recommended as they are readily available and can be reused.

See the following pages before creating a basic setup for your environment:

Let us consider a case where a new member enrolls on an existing policy and creates a business event NEWMEMBER on the policy.

Prerequisites

Following are the prerequisites to define a business event rule:

  • An application configured to process a policy. Run the following request to create a policy process flow:

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/policyprocessflows
      {
        "code": "DEFAULT",
        "defaultProcessFlow": false,
        "active": true,
        "descr": "Default process flow",
        "subtype": "PPFL",
        "policyProcessStepList": [
          {
            "displayName": "COMPARE",
            "compareVersions": true,
            "sequence": 1
          }
       ]
      }
  • A policy where compare step is present. See Process a Policy for more information.

Configure the Setup

Business Event Definition

  1. Run the following request to get an empty payload to create a business event rule:

    GET http://[hostName]:[portNumber]/[api-context-root]/generic/businesseventrules/create-form
  2. Run the following request to find out the domain of an entity or an attribute:

    GET http://[hostName]:[portNumber]/[api-context-root]/generic/businesseventrules/metadata

    Contact the support team for missing domain of an attribute.

  3. Run the following request and use the example payload to create a business event definition:

POST http://[hostName]:[portNumber]/[api-context-root]/generic/businesseventdefinitions
{
  "displayText": "New member was added to the policy.",
  "code": "NEWMEMBER",
  "descr": "New member business event"
}

Business Event Rule

  1. Run the following request to search for example payloads:

    GET http://[hostName]:[portNumber]/[api-context-root]/generic
  2. Search for the term businessevent in the response payload returned by the above request.

  3. Run the following request to get an empty payload to create a business event definition:

    GET http://[hostName]:[portNumber]/[api-context-root]/generic/businesseventdefinitions/create-form
  4. Run the following request and use the example payload to create a business event rule:

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/businesseventrules
    {
      "code": "NEWMEMBER",
      "eventAction": "A",
      "enabled": true,
      "entity": "PolicyEnrollment",
      "businessEventDefinition": {
        "code": "NEWMEMBER"
      }
    }

Test the Use Case

  1. Search for a policy.

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/policies/search
    {
      "resource":
      {
        "q":"code.<policycode>"
      }
    }
  2. Copy the gid from the response say, <policygid> is the gid of the policy.

  3. Run the following request to check for exisiting policy enrollment events on the policy:

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/policyenrollmentevents/search
    {
      "resource":
      {
        "q":"policyGid.eq('<policygid>')"
      }
    }

    A 204 no content response denotes that there have been no business event rules processing for this policy.

  4. Add a member to the policy. See Add Member to a Policy for more information.

  5. Run and submit the policy. See Process a Policy for more information.

  6. Run the following request to check the status of the enrollment event:

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/policyenrollmentevents/search
    {
      "resource":
      {
        "q":"policyGid.eq('<policygid>')"
      }
    }

    A successful response denotes that a business event rule has been created and implemented.