Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing Business Process Server adapters : Using the setProcessContextData method
 

Using the setProcessContextData method

You may implement the setProcessContextData method to obtain information on the current adapter or the currently executed process. The process context information is returned in a hashtable. To utilize this new feature, the adapter class must implement the setProcessContextData(Hashtable ht) function.
The information presented in the following table is available to the adapter class from the hashtable:
Table 11. Information available to the adapter class from the hashtable
Type
Key
Value
CHARACTER
ProcessTemplateName
<ProcessTemplateName>
CHARACTER
ProcessInstanceName
<ProcessInstanceName>
CHARACTER
WorkstepName
<WorkstepName>
INT64
ProcessInstanceID
<ProcessInstanceID>
INT64
WorkstepID
<WorkstepID>
Hashtable1
MappedInputDataslots
(MappedInputslotName,InputslotName)
Hashtable2
MappedOutputDataslots
(MappedOutputslotName,OutputslotName)
Hashtable
DataslotTypes
(DataslotName, DataslotType)
LOGICAL
SYNCHRONOUS
<true or false>
INTEGER
LOOPCOUNTER
<Workstep loopcounter>
Hashtable1 and Hashtable2 have "mappedDataslotName" and "originalDataslotName" as key–value pairs. If, for example, you have an adapter with the input dataslots "name" and "address", and output dataslots "salary" and "tax", then the input dataslots are mapped to epName and epAddr respectively. Output dataslots remain the same, and they are not mapped.
To obtain the mapped dataslot names for this adapter class, you must implement the method public void setProcessContextData(Hashtable processCtx). From inside this method, mapped dataslot names for the adapter are obtained as a hashtable.
The line/code Hashtable inpSlots = processCtx.get("MappedInputDataSlots") returns the "MappedInputDataSlots" in a hashtable. The returned hashtable inpSlots contains epName, name and epAddr, address as the key–value pairs. These pairs correspond to the mappedName -> epAddr, originalSlotName-> address and for the input dataslots of the adapter.
Similarly, hashtable outSlots = processCtx.get("MappedOutputDataslots"); have salary, salary and tax, tax as the key–value pairs. Since these values are not mapped, the mapped name and the original name remain the same.