Adapter Development Kit 6.5 | webMethods Adapter Development Kit Documentation | webMethods Adapter Development Kit Installation and User’s Documentation | Adapter Services | The Metadata Model for Adapter Services | Adapter Service Execution | Interacting with the Pipeline
 
Interacting with the Pipeline
At run time, an adapter service needs to retrieve data from the pipeline at the beginning of its execution, and to add data to the pipeline at the end of execution.
To retrieve data from the pipeline, the service should interrogate the WmRecord argument of the execute method. Limit the interrogation to fields identified in the service's signature because often there is other information in the pipeline that is not intended for the service.
At the end of execution, the execute method should return a WmRecord instance containing data that should be added to the pipeline. Organize the return data in a way that is consistent with the metadata signature so that other adapter services (or flow or Java services) can access it.
For discussion purposes, assume the following as a sample metadata signature for both input and output of an adapter service:
Field Name
Type
customer.id
java.lang.Integer
customer.name
java.lang.String
customer.orders[].id
java.lang.Integer[]
customer.orders[].date
java.util.Date[]
customer.orders[].lineItems[].itemNumber
java.lang.Integer[][]
customer.orders[].lineItems[].quantity
java.lang.Integer[][]
customer.orders[].lineItems[].description
java.lang.String [][]
The sample signature describes a hierarchal structure that can be expressed as a tree structure, where the actual field names form the leaves, and the elements preceding the field name are nodes. Thus, the names customer, orders, and lineItems are node names, and id, name, date, itemNumber, quantity, and description are leaves in the tree structure.
The WmRecord class, which is the primary carrier of data into and out of adapter services, is a JCA-based wrapper for an IData object. It provides methods that access the IData content. However, when dealing with a hierarchal structure (as is the case with the sample), it is necessary to "drill down" into the IData structure. Therefore, ignore the WmRecord methods except for getIData, and putIData (which is used to access the underlying IData object).
Note:
The IData interface is part of the standard webMethods Integration Server Java API. Its structure is based on key/value pairs, where the key is a String and the value is a Java object. For more information, see the Javadoc entries for IData, IDataCursor, IDataFactory, and IDataUtil, located in the Integration Server_directory \doc\api\Java directory.