A sample code segment with the previously mentioned methods in the adapter class is shown here:
public void setAllInputDataslots(Hashtable inputDS) {
//suppose:
/ - inputSlot1 and inputSlot2 are string dataslots.
// - inputSlot1 is not mapped.
// - inputSlot2 is mapped to XXX.
//You can get the two dataslot values using the following code:
inputSlot1Value = (String)inputDS.get("setinputSlot1");
inputSlot2Value = (String)inputDS.get("XXX");
...
}public Hashtable getAllOutputDataslots () {
//suppose:
// -outputSlot1 and XXX are string variables in EP
// and they are both the output of the EP.
// you can put the two output values into return
// hashmap using the following code:
Hashtable outputDS = new Hashtable ():
Hashtable inputDS represents the hashtable with variable name "inputDS" that contains all the input dataslots.
inputSlot1 and inputSlot2 represent application dataslots.
getAllOutputDataslots throws an exception for missing output dataslots and suspends the adapter.
You can use the setAllInputDataslots() and getAllOutputDataslots)() methods to pass all dataslot values at once between the BP Server and the adapter instead of the individual getter/setter. However, it also supports getter/setter for each dataslot. If setAllInputDataslots() or getAllOutputDataslots() is defined in the adapter, then it is used. Otherwise the BP Server tries to use the dataslot getter/setter.
If dataslots, which are not declared as output for an adapter, are passed in the hashtable, then the BP Server ignores these dataslots while updating.
In cases where dataslots values are mapped to new names, both the hashtables described above have mapped names as their keys.