Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing Business Process Server adapters : About BP Server adapters : Synchronous adapters : Asynchronous adapters
 
Asynchronous adapters
For asynchronous adapters, BP Server calls the adapter but does not wait for the adapter to finish its tasks. Use this feature for an adapter which takes a long time to complete (for example, for benchmarks), since the connection is closed between the workflow engine and the adapter.
Note: For further information on creating and using asynchronous adapters, see the OEBPS_HOME\BPServer\examples\AsyncAdapterTest.zip file.
The adapter requires certain information about BP Server, the process template, and the work item name. For this, define the method PAKcallerID() in the adapter class.
public void PAKcallerID(String processInstanceName, String workstepName,java.util.Properties bizLogicHost);
where PIName is the name of the process instance and WSName is the name of the workstep. BPServerLocation has the following keys:
APPSERVER — The type of application server, such as WebLogic, WebSphere.
JNDI_NAME — The JNDI name of BP Server by which it is binded to the JNDI of the application server.
The following keys are used to get the Initial context.
INITIAL_FACTORY: the initial context factory for the appserver (javax.naming.Context.INITIAL_CONTEXT_FACTORY).
PROVIDER_URL: the url where the bizlogic server is binded to the jndi
(javax.naming.Context.PROVIDER_URL).
CREDENTIALS: the password to connect to the
appserver(javax.naming.Context.SECURITY_CREDENTIALS).
PRINCIPAL: the user name to connect to the appserver
(javax.naming.Context.SECURITY_CREDENTIALS).
To get the BP Server remote object, first obtain the initial context factory and then locate the BP Server home object using the jndi binded name. Invoking create() on the home object gives the BP Server remote object.
The PAKcallerID method is called before BP Server breaks the connection to the adapter. This information is required to complete a task.
Note: For custom asynchronous adapters with output dataslots, the completeCallerWS() method can be called from the execute or PAKcallerID() method. For these adapters, the getAllOutputDataslots() or individual getter methods are never invoked.
BP Server calls this method to set the process template name, work item name, and the JNDI information of BP Server. If the adapter has no output dataslots, then the adapter is completed and the application continues to the next workstep.
Note: An asynchronous adapter may behave like a synchronous external adapter when it contains output dataslots.
Asynchronous adapters are of two types:
*With output dataslots — With output dataslots, an asynchronous adapter behaves like a synchronous adapter; that is, it waits for the asynchronous adapter class to complete the adapter.
*Without output dataslots — In this case, the next workstep is activated immediately after activating this adapter workstep.
To complete the asynchronous adapter that has output dataslots, call the function completeCallerWS(). The parameters are BP Server session, process template name, work item name, and a hashtable that contains dataslot values for you to update before completing the adapter.
Only the asynchronous adapter calls the BP Server.