Generate Notification Events Post Approval

Purpose

The purpose of this page is to provide the steps to set up notification events in the policies' application. The use case can be configured on both, the UI and through APIs. Here, APIs are recommended as they are readily available and can be reused. See Enrollment Event Notifications for more information.

Let us consider a case where a notification is sent upon enrolling a new member on an existing policy. The notification triggers post approval of a policy.

Prerequisites

Following are the prerequisites to generate a notification:

Configuration Steps

  1. Create a policy process flow with send post approval notification step:

    {
        POST http://[hostName]:[portNumber]/[api-context-root]/generic/policyprocessflows
      {
        "code": "DEFAULT",
        "defaultProcessFlow": false,
        "active": true,
        "descr": "New process flow",
        "subtype": "PPFL",
        "policyProcessStepList": [
          {
            "displayName": "COMPARE",
            "compareVersions": true,
            "sequence": 1
          }
       ]
      }
    }
  2. Run the following request to search for example payloads:

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

  4. Run the following request to get an empty payload to create a notification definition:

    GET http://[hostName]:[portNumber]/[api-context-root]/generic/notificationdefinitions/create-form
  5. Run the following request and use the example payload to create a notification definition:

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/notificationdefinitions
    
    {
        "code": "<notificationcode>",
        "emitNotification": "POST APPROVAL",
        "businessEventDefinition": {
            "id": <businesseventdefinitionid>
        }
    }

Test the Use case

  1. Search for a policy.

    POST http://[hostName]:[portNumber]/[api-context-root]/generic/policies/search
    {
        "resource":
        {
            "q":code.eq("<policycode>)"
        }
    }

    Copy the gid from the response. Let us say that the gid is <policygid>

  2. Add a new policy enrollment to a policy. See Add Member to a Policy for more information.

  3. Submit the policy. See Process a Policy for more information.

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

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

    The response has an attribute notificationStatus as SENT.