Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Using the Services for Managing Namespace Nodes | Polling Notification Services | wm.art.dev.notification:createListenerNotificationNode
 
wm.art.dev.notification:createListenerNotificationNode
This service creates a new instance of a synchronous or asynchronous listener notification in the specified package and folder from the specified notification template and connection alias. You must populate the input pipeline according to the table below before calling this service. To obtain a list of supported listener notification template and schedule properties, call the service wm.art.dev.notification:fetchListenerNotificationTemplateMetadata.
The value of a property's systemName attribute is the internal name of the property. When constructing the input parameter notificationSettings, use this internal name as the key for setting a property's value. For example, if a notification template defines a property named foo, then its systemName (as returned by fetchListenerNotificationTemplateMetadata) would be foo. If a Java application calls the service, it might use this information to set this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData ntfySettings = IDataFactory.create();
IDataCursor ntfyCursor = ntfySettings.getCursor();
ntfyCursor.insertAfter("foo", "bar");
.
.
.
pipeCursor.insertAfter("notificationSettings",
ntfySettings);
.
.
.
This example assumes that the property foo takes a java.lang.String value.
Listener notification properties may or may not have default values, depending on the specific notification's implementation. You may use these default values or override them with values that conform to the underlying data types of the properties. You must explicitly set all required properties in the input parameter notificationSettings . A required property is one whose metadata attribute isRequiredis set to true. (The isRequired attribute is contained in fetchListenerNotificationTemplateMetadata.)The absence of the isRequiredattribute implies that the property is not required. If you fail to set a required property, the service throws an exception. In addition, be aware of any properties that may become required based on the current value of some other property. This service will not try to locate and assign defaults for properties that you have omitted.
The particular combination of input parameters you specify determines whether you create a synchronous or an asynchronous listener notification. The table below identifies which parameters are synchronous- or asynchronous-only. This service throws an exception if you specify invalid or ambiguous combinations of input parameters.
You configure asynchronous listener notifications in a manner similar to how you configure polling notifications. In fact, a polling notification is actually a kind of asynchronous notification. Each time an asynchronous listener notification is triggered, it attempts to generate a run-time publishable output document. The format of this document (the names and types of the data fields it holds) is predefined. This service provides the input parameter publishableRecordDef for this purpose. You construct this parameter in the same manner that you construct notificationSettings(as described above). The difference is that the fieldNamesand fieldTypesproperties of publishableRecordDef each view an array of String. There is a one-to-one correspondence between the elements in these two arrays.The values you assign to these properties should correspond to fields that the notification class outputs in its runNotification()method. (If you specify an empty publishableRecordDef it will probably not execute properly.) This service does not validate that the fields in the publishable document are actually generated by the notification. By default, this service creates a publishable document node in a folder named notificationNamePublishDocument (where notificationName is the value you specify for the input parameter notificationName). This name is not configurable.
The service initializes the notification in a disabled state. After calling createListenerNotificationNode, you must call the service enableListenerNotification to activate it. For more information, see the webMethods Integration Server Built-In Services Reference for your release.
Be aware of any resource domains registered by the listener notification template, and set the new notification's properties according to the interdependencies between resource domains. Knowledge of these interdependencies is notification-specific, and beyond the scope of this service. This service does not interpret resource domains.
Input Parameters
notificationName
String. Required. The namespace folder:node name of the new notification.
packageName
String. Required. The package in which to install the notification.
listenerNode
String. Required. The namespace folder:node name of the notification's listener.
notificationTemplate
String. Required. The fully qualified pathname of the listener notification template class; see note 1.
notificationSettings
IData. Required. The structure for passing the listener's property values.
.systemName
The value of the systemName property; see notes 2, 3, and 4.
serviceName
String. For synchronous notifications only; required. The node name of the service to invoke. This parameter must not be null.
publishableRecordDef
IData. For asynchronous notifications only; required. The definition of the run-time publishable output document.
.fieldNames
String[]. The names of the fields used in the notification's output document.
.fieldTypes
String[]. The data types of the fields used in the notification's output document; see note 2.
requestRecordDef
IData. For synchronous notifications only; required. The definition of the request document sent to serviceName. This parameter must not be null, but may be empty.
.fieldNames
String[]. The names of fields used in notification's request document
.fieldTypes
String[]. The data types of fields used in notification's request document; see note 2.
replyRecordDef
IData. For synchronous notifications only; required. The definition of the reply document received from serviceName. This parameter must not be null, but may be empty.
.fieldNames
String[]. The names of fields used in notification's reply document
.fieldTypes
String[]. The data types of fields used in notification's reply document; see note 2.
Note: 
1. Synchronous listener notification classes should extend the WmSyncListenerNotification class. Asynchronous listener notifications should extend the WmAsyncListenerNotification class.
2. The following Java data types are supported for listener notifications: char, short, int, long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean. Arrays of all the above data types are also supported.
3. The implementation of the notification determines whether a particular property is required. To determine whether a property is required, call the service wm.art.dev.notification:fetchListenerNotificationTemplateMetadata and check whether its isRequired attribute is set to true. If you do not provide a value for a required property, createListenerNotificationNode throws an exception.
4. The number of properties to be configured is notification-dependent. At a minimum, set those properties whose isRequired attribute is set to true.
Output Parameters
None.