Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing Business Process Server adapters : Developing adapters : Using setAllInputDataslots and getAllOutputDataslots
 

Using setAllInputDataslots and getAllOutputDataslots

In addition to using the set/get method to develop adapters, the BP Server provides a way to invoke a single method to either retrieve or update multiple dataslot values at once. The setAllInputDataslots and getAllOutputDataslots methods package all input or output dataslots in one method. These methods send or receive all dataslot values in a hashtable. You may use this feature in place of calling a get/set method for a single dataslot value to improve application performance.
Note: You can use either the set/get method for each individual dataslot or implement the setAll/getAll methods. But you cannot use the individual getter method for input dataslots with the getAllInputDataslots(Hashtable) methods implemented from the same adapter class.
In order to implement and use this feature, the adapter classes must implement the following two functions:
1. setAllInputDataslots (Hashtable ht) retrieves all the input dataslots
This method gets all the input dataslots in the form of a hashtable from the BP Server. The hashtable passed to setAllInputDataslots from the BP Server contains the following information for each input dataslot:
*Key: <InputDataSlotMappedName>
*Value: <InputDataSlot -Value>
2. getAllOutputDataslots ( ) updates all the output dataslots
The adapter classes use this method to pass all the output dataslots along with the new values in the form of a hashtable to the BP Server.
The hashtable passed from getAllOutputDataslots to the BP Server inside the adapter contains the following information for each output dataslot:
*Key: <OutputDataSlotMappedName>
*Value: <OutputDataSlot -Value>
If all the output dataslots exist in the hashtable passed from the adapter, then the BP Server updates the output dataslot values with the new values .
Note: In both hashtables described above, the hashtable value is passed as a Java object. You can use the Java API to retrieve the data types for the dataslots returned as Java objects. For example, assume that OutputDS1Obj is the Java class passed in value for the OutputDS1 key. You can retrieve the Java data type associated by invoking OutputDS1Obj.getClass().getName(). This returns Long, Double, String, or other objects for object dataslots, depending on the Java data type for OutputDS1. The setProcessContextData method also retrieves this.
* Sample code