Publish Events in an Integration

You can create an integration that publishes an event. Running the publishing integration enables subscribing integrations to subscribe to this event. This section provides an example of how to create a publishing integration.

  1. In the navigation pane, click Design, then Integrations.
  2. Click Create, then select the integration pattern to use.

    Note:

    Do not select Event as the integration pattern to publish the event. That pattern is for the integration that subscribes to the event. For this example, Application is selected to create an application integration.
  3. Add a trigger connection to the integration. For this example, a REST Adapter is selected and configured with the following details shown on the Summary page of the Adapter Endpoint Configuration Wizard:
    • Endpoints relative resource URI: /patient
    • Action to perform on the endpoint: POST
    • Query parameters specified: patientId, fromDept, and toDept (these are the parameters defined in the event file)


    The Cancel button appears at the top. The Previous and Next icons appear at the top. Between the two icons are buttons for each page in the wizard. The Summary page is selected. The Endpoint Summary section is expanded to show the REST Service URL (/patient), Method (POST), and Query Parameters (patientId, fromDept, and toDept).

  4. Drag a Publish event action into the integration canvas. See Publish Events in an Integration with a Publish Event Action.
    The Choose event panel opens.
  5. Select the event to publish, and click Choose. For this example, Patient Moved is selected. You can also create a new event from this panel by selecting Define new event.


    The Choose event dialog shows Publish details. The Search field appears. Patient appears in the field. To the right is the Define new event button. Below this are the search results for events with patient in the name. At the far right is the View Details icon.

    The contents of the event are visible under the View details View details icon icon:

    {
        "patientId": "value1", 
        "fromDept": "value1", 
        "toDept": "value1"
    }
  6. Click Choose, then click Finish.
  7. Open the Map action that is automatically added above the Publish event action.
  8. Map the source elements to the target elements. For this example, the three query parameters specified in the REST Adapter are mapped to the JSON event: Patient Id, From Dept, and To Dept.

    The mapper shows the Sources, Mapping canvas, and Target sections. The elements being mapped appear above this image.
  9. Save and activate the integration.
    You are now ready to create the integration that subscribes to this event.