Adapter Development Kit 9.12 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Using the Services for Managing Namespace Nodes | Overview | Listener Notification Services | wm.art.dev.notification:createListenerNotificationNode
 
wm.art.dev.notification:createListenerNotificationNode
This service creates a new synchronous or asynchronous listener notification node in the specified package and folder from the specified notification template and connection alias, and initializes the listener notification node in a disabled state.
You must perform the following steps to populate the input pipeline:
1. Use wm.art.dev.notification:fetchListenerNotificationTemplateMetadata service to identify the supported listener notification template properties and configure the notificationSettings input parameter.
*Listener notification properties may or may not have default values, depending on the specific adapter's implementation.
*Depending on the underlying data type of the property, it might not be possible to assign a default value to a property.
*You may use the default values or override them with values that conform to the underlying data types of the properties.
*The property values are not automatically set to their default values; you must explicitly set all the required properties.
*If you omit a property, then no attempt is made to locate and assign default values to the property.
*Listener notification properties may be optional or a required property.
*A required property is identified when the isRequired metadata attribute is set to true.
*The absence of the isRequired attribute implies that the property is not required.
*If you fail to set a required property, the wm.art.dev.notification:createListenerNotificationNode service throws an exception.
*You may have properties that might be required, based on the current value of some other property.
*The number of properties to be configured is adapter-dependent. At a minimum, set those properties whose isRequired attribute is set to true.
2. The particular combination of input parameters you specify determines whether you create a synchronous or an asynchronous listener notification as described in the section for input parameters. This service throws an exception if you specify invalid or ambiguous combinations of input parameters.
3. When an asynchronous listener notification is triggered, Integration Server generates a runtime publishable output document.
*The names and types of the data fields in the publishable output document is predefined.
*Specify the names and types of the data fields in the publishable output document in the service's publishableRecordDef input parameter.
*The publishableRecordDef input parameter consists of fieldNames and fieldTypes properties.
*The data types of properties in the publishableRecordDef structure are arrays of java.lang.String type.
*The fieldNames and fieldTypes properties are an array of String.
*A one-to-one correspondence exists between the elements in these fieldNames and fieldTypes arrays.
*The values assigned to the fieldNames and fieldTypes properties must correspond to fields that the listener notification class outputs in its runNotification method.
*The service execution may fail if an empty publishableRecordDef is specified.
4. Activate the listener notification node using the pub.art.notification:enableListenerNotification service.
For more information, see the webMethods Integration Server Built-In Services Reference for your release.
Note: 
1. This service does not validate that the fields in the publishable document are actually generated by the notification.
2. This service creates a publishable document node in a notificationNamePublishDocument folder where notificationName is the value you specify for the notificationName input parameter. The name of publishable document is not configurable.
The resource domains registered by the listener notification templates are set in the listener notification's properties according to the interdependencies between the resource domains. Knowledge of these interdependencies is adapter-specific, and beyond the scope of this service. This service does not interpret resource domains.
Note: 
1. Synchronous listener notification classes must extend the WmSyncListenerNotification class.
2. Asynchronous listener notifications must extend the WmAsyncListenerNotification class.
Input Parameters
Name
Description
notificationName
String. Required. Name of the listener notification in the format: folder:node.
packageName
String. Required. Package where the listener notification is installed.
listenerNode
String. Required. Name of the listener in the format: folder:node.
notificationTemplate
String. Required. Fully qualified pathname of the listener notification template class.
notificationSettings
IData. Required. Structure for passing the listener notification's property values.
systemName
String. Required. Internal name of the property.
*The following Java data types are supported for connections: 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.
Properties applicable to synchronous listener notifications only
serviceName
String. Required. Name of the service to invoke in the format: folder:node. This parameter must not be null.
executionMode
IData. Structure to identify whether a service defined in serviceName is invoked or a document is published.
mode
String. Possible values are:
*publishAndWait. Publish the document and wait for the response.
*invokeService. Invoke the service defined in serviceName parameter.
local
Boolean. Enables publishing the document locally.
waitTime
String. Time in millisecond to wait for the response in an synchronous listener notification.
jmsSettings
IData. Structure specifying the JMS setting.
isJMSConfigured
Boolean. Specifies whether the document is published to a JMS provider.
ConnectionAliasName
String. Required. Connection name of the JMS provider. This field is relevant if the value of isJMSConfigured is true.
DestinationName
String. Required. Name of the destination where the document is published. This field is relevant if the value of isJMSConfigured is true.
DestinationType
String. Required. Type of destination where the document is published. Possible values are:
*Queue
*Topic
This field is relevant if the value of isJMSConfigured is true.
requestRecordDef
IData. Required. Structure specifying the definition of the request document sent to serviceName. This parameter must not be null, but may be empty. This property contains the following fields:
fieldNames
String[]. Names of the fields used in the listener notification's request document.
fieldTypes
String[]. Data types of the fields used in the listener notification's request document.
replyRecordDef
IData. Required. Structure specifying the definition of the reply document received from serviceName. This parameter must not be null, but may be empty. This property contains the following fields:
fieldNames
String[]. Names of the fields used in the listener notification's reply document.
fieldTypes
String[]. Data types of the fields used in the listener notification's reply document.
Properties applicable to asynchronous listener notifications only
publishableRecordDef
IData. Required. Structure specifying the definition of the runtime publishable output document. This property contains the following fields:
fieldNames
String[]. Names of the fields used in the listener notification's output document.
fieldTypes
String[]. Data types of the fields used in the listener notification's output document.
Output Parameters
None.
Example
You must construct notificationSettings to create a listener notification node. The value of a property's systemName is the internal name of the property. When constructing the notificationSettings input parameter, you must use this internal name as the key for setting a property's value. For example, if a listener notification template defines a property named foo, then its systemName as returned by fetchListenerNotificationTemplateMetadata service is foo. If the caller is a Java application, 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("foo", "bar");
.
.
.
pipeCursor.insertAfter("notificationSettings",
ntfySettings);
.
.
.
In this example, the foo property takes a java.lang.String value.