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:createPollingNotificationNode
 
wm.art.dev.notification:createPollingNotificationNode
This service creates a new instance of a polling 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 template and schedule properties, call the service wm.art.dev.notification:fetchPollingNotificationTemplateMetadata.
The value of a property's systemName attribute is the internal name of the property. When constructing the notificationSettingsinput parameter, use this internal name as the key for setting a property's value. For example, if a notification template defines a property named sqlCommand, then its systemName (as returned by fetchPollingNotificationTemplateMetadata) would be sqlCommand. If a Java application calls the service, it might then 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("sqlCommand", "SELECT * FROM fooTable");
.
.
.
pipeCursor.insertAfter("notificationSettings", ntfySettings);
.
.
.
This example assumes that the property sqlCommand takes a java.lang.String value.
Polling 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 fetchPollingNotificationTemplateMetadata.)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.
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.
You specify the format (the names and types of the fields) of the publishable document by populating the publishableRecordDefparameter with the names and types of any notification fields that may appear in the document generated by the notification. You construct this parameter in the same manner 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. Also, the values assigned 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.
The service initializes the notification in a disabled state. After calling createPollingNotificationNode, you must call the service enablePollingNotification to activate it. For more information, see the webMethods Integration Server Built-In Services Reference for your release.
In addition, you can set the notification's delivery schedule using the input parameter scheduleSettings. By default, a newly-created notification has no assigned delivery schedule. You must configure the notification's delivery schedule before calling enablePollingNotification. To do this, provide a valid scheduleSettingsinput parameter to either createPollingNotificationNode or updatePollingNotificationNode.
Be aware of any resource domains registered by the polling 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.
connectionAlias
String. Required. The namespace folder:node name of the connection.
notificationTemplate
String. Required. The fully qualified pathname of the polling notification template class.
notificationSettings
IData. Required. The structure for passing the notification's property values.
.systemName
The value of the systemName property; see notes 1, 2, and 3.
scheduleSettings
IData. Required. The notification's schedule settings.
.notificationInterval
Integer. The frequency of the polling (in seconds).
.notificationOverlap
Boolean. Specifies whether notifications can overlap.
.notificationImmediate
Boolean. Specifies whether to fire the notification immediately.
publishableRecordDef
IData. Required. The definition of the run-time publishable output document.
.fieldName
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 1.
Note: 
1. The following Java data types are supported for polling 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.
2. 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:fetchPollingNotificationTemplateMetadata and check whether its isRequired attribute is set to true. If you do not provide a value for a required property, createPollingNotificationNode throws an exception.
3. 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.