Scenario: Notifying a User after an Adabas Database Record is Updated

Scenario: I have a mainframe Adabas database and want to notify a user when a record is updated.

Solution: Use the Event Replicator for Adabas to send a message to the webMethods Integration Server via EntireX Broker, and use Integration Server logic to send an email to the target user.

graphics/ars-scenarios-broker-steps.png

graphics/blue_1.gif Event Replicator for Adabas listens for specific actions on the database.
graphics/blue_2.gif Event Replicator for Adabas sends an XML message to Integration Server via EntireX Broker
graphics/blue_3.gif The EntireX Adapter listens to the respective message queue and triggers an IS service to send the email.

This scenario requires the following Software AG products:

  • Mainframe Adabas

  • Event Replicator for Adabas

  • webMethods Integration Server

  • EntireX Broker

  • EntireX Adapter

This scenario consists of the following steps:


Step 1 - Configure your Integration Server

This section covers the following topics:

Check the EntireX Adapter Package is Available

Before you begin, ensure that the EntireX Adapter package is available on the webMethods Integration Server.

Start of instruction setTo ensure that the EntireX Adapter package is available on the webMethods Integration Server

  1. In the webMethods Integration Server Administration interface, go to Packages > Management.

  2. Click on WmEntireX for details. A screen similar to this should be displayed (extract):

    graphics/ars-scenarios-direct-config-check.png

Creating an Adabas Replication Listener Connection

Start of instruction setTo create an Adabas Replication Listener Connection

  1. In the EntireX Adapter menu go to Connections. Click on Adabas Replication Listener Connection to display the following screen:

    graphics/ars-scenarios-broker-config-listener.png

  2. Add the name of the package where the connection is stored.

  3. Add the name of the folder where the connection is stored.

  4. Add the name of the connection.

  5. Add the ID of the broker you are using for this task.

  6. Add the server address in the format <class>/<server>/<service>.

  7. Add the user ID and password (if applicable).

    Note:
    All other parameters are optional. Normally you can use the default values for these. All parameters are described here.

  8. Click on Save Connection.

In the next step, create a listener for this connection, using the Adabas Replication Wizard.

Step 2 - Create Listener Objects with the Adabas Replication Wizard

Start of instruction setTo generate a listener and all required objects for an existing connection

  1. In the webMethods Integration Server, choose Adapters > EntireX Adapter > Connections and make sure the connection you created in the previous step is enabled.

    graphics/ars-scenarios-direct-create-enable.png

  2. In the Integration Server, choose EntireX Adapter > Adabas Replication Wizard.

    graphics/ars-scenarios-direct-create.png

  3. Select the connection you created previously.

  4. Enter the name of the new listener.

  5. Choose Create.

    The listener will be stored in the same location as the connection.

    Note:
    Document types can be optionally created to restrict the scope of the listening operation. See Create Document Type from Adabas File.

  6. Make sure the listner you created is enabled. Choose Enabled from the drop-down menu.

    graphics/ars-scenarios-direct-create-enableListener.png

Step 3 - Create Processing Logic for Flow Services

In the previous step you created the required listener objects with the Adabas Replication Wizard. Now you can add your own logic to perform the actions you require. In the example below we are sending an email with the updated data in XML format.

Start of instruction setTo customize the newly created flow service

  1. Open the flow service created in the previous step to add your custom logic.

    graphics/ars-scenarios-direct-flow-open.png

  2. Add a flow step BRANCH within the LOOP. This enables you to decide on a specific action for a particular field.

    graphics/ars-scenarios-direct-flow-addBranch.png

  3. In the Switch property, set the path to an attribute of the event data. In this case it is the method attribute of the event data.

    graphics/ars-scenarios-direct-flow-switch.png

  4. Under flow step SEQUENCE, specify what happens when the method has a particular value.

    graphics/ars-scenarios-direct-flow-sequence.png

  5. Set Label to Update and map document (the input format) to XML string.

    graphics/ars-scenarios-direct-flow-doc2xml.png

  6. Use the pub.sml:documentToXMLString service from the WmPublic package to create, from a document, an XML string that can be sent via email.

    graphics/ars-scenarios-direct-flow-map.png

  7. Specify the mail protocol, in our example "smtp". To send the mail you can use the public flow service pub.client:smtp from the WmPublic package.

    graphics/ars-scenarios-direct-flow-protocol.png

  8. Set the SMPT parameters.

    • Some fields are coded manually, for example to.
      These fields are marked with the icon graphics/ars-scenarios-direct-flow-map-manual.png

    • Other fields are filled dynamically with values from the flow service, for example subject.
      These fields are marked with the icon graphics/ars-scenarios-direct-flow-map-dynamic.png

    graphics/ars-scenarios-direct-flow-smptParms.png

    The result of these steps is an email where

    • the subject is dynamically filled with the value from the flow service

    • the addresse is coded manually in a mapping operation

    • the body is converted to XML and contains the fields that have been updated

      graphics/ars-scenarios-direct-flow-email.png