BPM Workflow and BP Server use the same set/get mapping methods, but use different dataslot naming conventions. The examples in this chapter follow the naming conventions used in BP Server.
Note: To see how to define set/get methods in the Adapter workstep, refer to "Mapping Dataslots in an Adapter Workstep" section of the OpenEdge Getting Started: Developing BPM Applications with Developer Studio.
BP Server uses the default mapping setX and getX for the methods (unless setAllInputDataslots and getAllOutputDataslots are defined in the adapter) corresponding to a dataslot named "X" used in an adapter. You can, however, use your own mapping. For example, in the Emailer adapter you might choose to associate the methods setEmailSubject, setEmailAddress, and appendEmailBody with the Subject, Recipient, and Content dataslots respectively.
In the Adapter workstep properties, select the dataslots as input or output to the adapter. For each input dataslot, one set method of the form set[dataslot_name]() should exist in the adapter code (public void setpath [String value], where path is a dataslot of type CHARACTER). Also, for each output dataslot, one get method of the form get[dataslot_name]() should exist (public String getDocURL(), where DocURL is a dataslot of type CHARACTER).
An example of a DATETIME-TZ and DECIMAL dataslot follows.
DateTime-TZ dataslot example
public void setDsDate(java.sql.Timestamp value) {
}public java.sql.Timestamp getDsDate() {
}
where the return type for date is java.sql.Timestamp.
DECIMAL dataslot example
public void setDsDecimal(java.math.BigDecimal value) {
}public java.math.BigDecimal getDsDecimal() {
}
where the return type for decimal is java.math.BigDecimal.
Finally, the performer method can be any name with the return type "void." This method executes the logic/work of the adapter.
Note: You can use either set/get method for each individual dataslot or implement the setAll/getAll methods. But they cannot contain the individual getter method for input dataslots or the getAllInputDataslots(Hashtable) methods implemented from the same adapter class. For more information about setAll/getAll methods, see Using setAllInputDataslots and getAllOutputDataslots.
Example
The TAXmeter adapter calculates the tax for specific amounts of money, which requires the following two inputs:
Amount of money
Tax bracket
The adapter produces one output: Result
As the adapter developer, you can either use the getResult method to calculate the return value, or define an intermediate method which performs the calculation and sets the value of an internal variable for return by the getResult method.