Try OpenEdge Now
skip to main content
Application Developer's Guide
Using Callback Adapter : Developing the Callback Adapter : Developing the Callback Adapter Java class
 

Developing the Callback Adapter Java class

The Callback Adapter is a locally deployed Java class which can be loaded in the same JVM where the Business Process Server component is running. The adapter class can be in any appropriate package and need not extend any special Java class or implement any interfaces.
Note: Remote java implementations (EJB or RMI adapter classes) are not supported.
A public constructor with no arguments can be used to define the class. This constructor is used to instantiate the adapter object and then the defined methods are invoked on this adapter instance.
The adapter instance is invoked synchronously with the change of state in the Business Process Server component. A new instance of the adapter is instantiated using the default constructor and this instance is destroyed after the defined state change method is invoked. There is no pooling of object instances.
Within the adapter class, the Java language classes and APIs (System and User defined) can be used as long as they are all available in the classpath of the EJB server component.
Each adapter class is loaded by a custom defined class loader which looks for the adapter classes in a specific folder specified by the adapter developer in an adapter configuration file. If the compiled adapter class file and other related classes used by the adapter cannot be located in this folder, then they are searched in the EJB server classpath and loaded from there.
A separate adapter is not required for each Business Process Server component. The same adapter class can be used for all the components but entries must be added for each of the component in the sbmcallback.xml file in the OEBPS_HOME\conf\resources\common folder. Each of the components (BP Server, BPM Events) runs as an independent application in the EJB server, creates an adapter instance, and sends separate notifications about its state changes. The administrator has the option of using the Callback Adapters for only the BP Server or the BPM Events server, without affecting the other component. By default, the Callback Adapter mechanism is disabled and no action is taken by the Business Process Server components on any change of state.
Callback adapter executes as part of the BP Server transaction. So BP Server passes the process context to the invoked callback adapters which includes piid, wsname, and other data. You can access 'JSTools' in the context so that callback adapater can perform all workflow operations, which includes dataslot read and write operations.
* Implementing adapter methods
* Using constructors
* Invoking adapter methods
* Compiling and testing the adapter