Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Using the Sample Adapter | Phase 5: Adding Listener Notifications
 
Phase 5: Adding Listener Notifications
 
Implementing the Listener
Implementing the Asynchronous Listener Notification Template
Revising the Code from Phases 1, 2, 3, and 4
Configuring and Testing the Listener and the Listener Notification Nodes
In this phase, the sample provides a listener and listener notification template that you can use to configure listener and listener notification nodes. The listener nodes receive alerts immediately from the Sample Server when checks are deposited and when the accounts have negative balances. This section describes how to:
*Implement the listener.
A listener object is connected to the adapter resource, waiting for the system to deliver notifications.
*Implement an asynchronous listener notification template.
An asynchronous listener notification publishes a document to a webMethods Broker queue, using the doNotify method. You must create a trigger that receives the document and executes an Integration Server flow service to process the document's data.
*Revise adapter definition, and adapter connection classes.
*Compile the phase 5 implementation.
Note:
The Phase 5 implementation is not compiled as the WmSampleAdapter package contains the Phase 5 (final) implementation.
*Configure the listener node.
*Configure two asynchronous listener notification nodes (one for check deposits, the other for negative balances).
Each node generates a document that will be used to contain the affected portion of the Sample Server data, and to inform the Integration Server of the changes.
*Create an Integration Server trigger and a flow service for each listener notification node.
The notifications publish the resulting documents to the triggers. Upon receiving a document generated by the listener notification, the trigger causes the Integration Server to invoke a flow service registered with the trigger to process the document's data. In the Sample Adapter, the flow service invokes the pub.flow:savePipelineToFile service. This service simply saves the contents of the pipeline from the listener notification event to a file. This service is used as a debugging tool. It is provided here simply to demonstrate the use of the notification. In a real adapter, you perform some kind of action with the notification data.
*Schedule and enabling the listener notification nodes.
*Test the listener notification nodes.