com.ibm.bpe.api
Interface ReplyContext

All Superinterfaces:
java.io.Serializable

public interface ReplyContext
extends java.io.Serializable

This interface supports an asynchronous mode of operation. A reply context has to be provided for callWithReplyContext methods.

A client that uses these API methods has to create an object that implements the ReplyContext interface so that the process engine knows where to send results to. When a process instance that was started via the callWithReplyContext() API reaches its end, the process engine calls replyProcessResult() or replyException() depending on the result of processing. It is the responsibility of the implementation of this interface to perform the necessary actions in order to inform the caller about the result of processing.


Field Summary
static long serialVersionUID
           
 
Method Summary
 void replyException(int processState, java.lang.String processInstanceName, java.lang.Exception exception)
          Signals that a system exception terminated process instance execution.
 void replyProcessResult(int processState, java.lang.String processInstanceName, java.lang.Object resultMessage)
          Signals the end of process execution.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

replyProcessResult

public void replyProcessResult(int processState,
                               java.lang.String processInstanceName,
                               java.lang.Object resultMessage)
                        throws SendReplyErrorException
Signals the end of process execution. If successfully executed, an output message is returned. If not successfully executed, a fault message is returned.

Parameters:
processState - The final state of the process instance, either finished, failed, terminated, or compensated.
processInstanceName - The name of the process instance.
resultMessage - The output or fault message that represents the result of execution.
Throws:
SendReplyErrorException - if the process instance result cannot be returned.

replyException

public void replyException(int processState,
                           java.lang.String processInstanceName,
                           java.lang.Exception exception)
                    throws SendReplyErrorException
Signals that a system exception terminated process instance execution.

Parameters:
processState - The state of the process instance.
processInstanceName - The name of the process instance.
exception - The exception that terminated processing. Can be any subclass of ProcessException or ProcessError or one of its subclasses.
Throws:
SendReplyErrorException - if the exception cannot be returned.