Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Using the Sample Adapter | Phase 4: Adding Polling Notifications | Implementing the Polling Notification Template
 
Implementing the Polling Notification Template
Define a polling notification by extending the com.wm.adk.notification.WmPollingNotification base class. The following packages, classes, and methods are added in the Sample Adapter; thereby allowing you to configure and monitor events
*A MessagePolling class created by extending the com.wm.adk.notification.WmPollingNotification base class.
You can monitor the following types of events using the polling notifications:
*CheckDepositStatusChange
The Sample Server records this event when a Clear Check or Bounce Check service clears (approves) or bounces (disapproves) a deposited check.
*UnderBalance
The Sample Server records this event when a Withdraw or Transfer service causes a negative account balance. The document is not published if the account's negative balance is greater than the available credit limit amount. For example, if the credit limit amount is 1000, and the account balance falls to -1001, the document is not published; an error is issued.
The bean properties declared in the MessagePolling class are as follows:
Property
Description
pollingName
Event to poll in the Sample Server.
inputParameterNames
Fully qualified input parameter names, including all the record structures and array indicators.
inputFieldValues
Unlike adapter services, polling notifications accept no runtime input data, other than the configured property values specified here.
inputFieldTypes
Input parameter data types, including all the array indicators.
outputParameterNames
Fully qualified output parameter names, including all the record structures and array indicators.
outputFieldNames
Fully qualified suggested output parameter signature names, including all the record structures and array indicators. You cannot change these names.
outputFieldTypes
Output parameter data types, including all the array indicators.
The resource domains declared in the MessagePolling class are as follows:
Resource Domain
Description
pollingNames
Looks up the list of Sample Server polling notification event names described in Banking Event Queries.
inputParameterNames
Looks up the fully qualified input parameter names, including all the record structures and array indicators.
inputFieldTypes
Looks up the input parameter data types, including all the array indicators.
outputParameterNames
Looks up the fully qualified output parameter names, including all the record structures and array indicators.
outputFieldTypes
Looks up the output parameter data types, including all the array indicators.
Implementing the runNotification Method
The template includes the runNotification method, which is called by the Integration Server based on the polling notification node's schedule. This method has no arguments and no return values; it merely publishes documents.
This method constructs an event query document with the query criteria input, and sends it to the Sample Server, and then waits for the reply document from the Sample Server. The query can produce one of three possible responses:
*Success with output: The notification succeeds, and receives a notification document.
*Success with no output: The notification succeeds, but no event has occurred. The notification receives an acknowledgment document.
*Failure: The notification fails and receives a negative acknowledgment document; an AdapterException is thrown with the appropriate error message.