Try OpenEdge Now
skip to main content
Application Developer's Guide
Developing Business Process Server adapters : Developing adapters : Handling adapter exceptions
 

Handling adapter exceptions

If you want to catch exceptions or display error messages thrown from an adapter during its execution, then the methods in the class invoked must throw exceptions in order for the BP Server to display these messages in the case of errors.
When the adapter execution fails and throws an exception to the caller, the BP Server captures that remote exception, logs the message and stack trace, suspends the Adapter workstep, and notifies the Business Process Server administrator by e-mail. Using the stack trace, the user can find exactly which method throws the exception and possibly the line number.
Note: If you do not want an exception thrown, then use a dataslot to assign the status of the application use (depending on the type of application and use).
An Adapter workstep exception is captured by BP Server, and BP Server tries to re-invoke the adapter. After specified re-tries, BP Server generates two events, EP_AFTERBREAK and W_SUSPENDED. Then, according to the requirement, applications can use any of the events to take further action. These events are also captured by BPM Events (or a simple event listener) to trigger corrective actions.
For the getAllOutputDataslots() method, the BP Server throws an exception in the following cases:
*Any of the output dataslots for this Adapter workstep are missing from the hashtable.
*Any data type mismatch in the values are passed from the hashtable.