Sonic ESB API

com.sonicsw.xq
Interface XQProcessContinuation

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
XQFaultProcessContinuation

public interface XQProcessContinuation
extends java.io.Serializable

Using Process continuations a user can interrupt a process flow and then continue it at a later time, potentially from a different location (thread/ container), without losing any of the process context. This feature enables better handling of asynchronous responses in ESB and other use cases that require passivation and reactivation of ESB processes.

The process continuation object contains all the state and context information required to continue the process instance at a later time. A service can obtain the continuation object by invoking the XQProcessContext.getProcessContinuation method. The continuation information can be stored as a simple string and can thus even be set as a message header. Depending on the use case users might choose to persist the continuation in a database, send it along with the message as a correlation header, save it in a cache, etc.

At a later time another service (standalone or within a process) can recreate the continuation object from the relevant data source and then continue the process instance using the information in the continuation.

User should implement XQProcessContinuationHandler to save and retrieve the continuation object to/from your data source (database, message header, cache, etc.)

Conceptually a process continuation can contain three levels of information:

 
 1. Level 0 (STATELESS): 
             The continuation only contains the top level process name
             and composite step name. The process continues from the 
             appropriate step but all other process context information 
             (like exit/RME/Fault, tracking info, process context 
             properties, etc) is lost
 2. Level 1 (PROCESS_CONTEXT): 
             In addition to level-0, the continuation also contains process
             context information (accessible via getProcessRuntime()). The
             process continues from the appropriate step and all the process
             context information is retained in the process instance. 
 3. Level 2 (ITINERARY): 
             In addition to level-1, the continuation also contains the 
             information related to the itinerary parts. This is suitable
             for really advanced cases like dynamic itineraries


Nested Class Summary
static class XQProcessContinuation.Level
          Denotes the level for the continuation.
 
Field Summary
static XQAddress NULL_ADDRESS
          Use this address object in your continuation object if you want to explicitly set for exit/fault/RME/tracking address in the activated process to null.
 
Method Summary
 java.lang.String getCompositeStepName()
          Returns the name of the step to be continued.
 java.lang.String getCurrentProcessName()
          Returns the name of the current (inner most) process to be continued.
 java.lang.String getID()
          Returns the unique ID for the continuation.
 XQProcessContinuation.Level getLevel()
          Get the level for this continuation
 java.lang.Object getProcessInstanceData()
          Returns additional process instance data.
 XQRuntimeProcess getProcessRuntime()
          Returns the process context information for the process to be continued.
 java.lang.String getRootProcessName()
          Returns the name of the top parent process to be continued.
 void setCompositeStepName(java.lang.String stepName)
          Set the name of the step to be continued.
 void setCurrentProcessName(java.lang.String processName)
          Set the name of the current (inner most) process to be continued.
 void setCurrentProcessStepName(java.lang.String stepName)
          Set the name of the step in the current process to be continued.
 void setID(java.lang.String id)
          Optional method to set a unique ID for the continuation
 void setLevel(XQProcessContinuation.Level level)
          Set the level for this continuation
 void setProcessInstanceData(java.lang.Object procInstData)
          Set additional process instance data.
 void setProcessRuntime(XQRuntimeProcess runtimeProcess)
          Set the process context information for the process to be continued.
 void setRootProcessName(java.lang.String topProcessName)
          Set the name of the top parent process to be continued.
 

Field Detail

NULL_ADDRESS

static final XQAddress NULL_ADDRESS
Use this address object in your continuation object if you want to explicitly set for exit/fault/RME/tracking address in the activated process to null. If an optional field in the continuation object is null then it is ignored while setting the process context during process activation. Therefore use this object if you want to explicitly set one of the aforementioned address values to null in the activated process.

Method Detail

setID

void setID(java.lang.String id)
Optional method to set a unique ID for the continuation

Parameters:
id - Unique ID to identify the continuation

getID

java.lang.String getID()
Returns the unique ID for the continuation.

Returns:
Return ID or null

setLevel

void setLevel(XQProcessContinuation.Level level)
Set the level for this continuation

Parameters:
level - Continuation level

getLevel

XQProcessContinuation.Level getLevel()
Get the level for this continuation

Returns:
Continuation level

setCurrentProcessName

void setCurrentProcessName(java.lang.String processName)
Set the name of the current (inner most) process to be continued.

Parameters:
processName - Name of the process

getCurrentProcessName

java.lang.String getCurrentProcessName()
Returns the name of the current (inner most) process to be continued.

Returns:
Return the process name

setRootProcessName

void setRootProcessName(java.lang.String topProcessName)
Set the name of the top parent process to be continued. This is useful in the case of nested processes.

Parameters:
topProcessName - Name of the top most process

getRootProcessName

java.lang.String getRootProcessName()
Returns the name of the top parent process to be continued.

Returns:
Return the top process name

setCompositeStepName

void setCompositeStepName(java.lang.String stepName)
Set the name of the step to be continued. In the case of a nested process the step name should be a composite value that contains the step names of all the parent processes in the invocation chain.

Parameters:
stepName - Name of the step

setCurrentProcessStepName

void setCurrentProcessStepName(java.lang.String stepName)
Set the name of the step in the current process to be continued.

Parameters:
stepName - Name of the step

getCompositeStepName

java.lang.String getCompositeStepName()
Returns the name of the step to be continued. This will be a composite name in the case of nested process.

Parameters:
Return - the name of the step to be continued.

setProcessRuntime

void setProcessRuntime(XQRuntimeProcess runtimeProcess)
Set the process context information for the process to be continued. This is used for Level 1 and Level 2 continuations.

Parameters:
runtimeProcess - process context information

getProcessRuntime

XQRuntimeProcess getProcessRuntime()
Returns the process context information for the process to be continued. In the case of Level 0 continuations this method will return null.

Returns:
The process context information or null

setProcessInstanceData

void setProcessInstanceData(java.lang.Object procInstData)
Set additional process instance data. This is used for Level 2 continuations.

Parameters:
Return - ID or null

getProcessInstanceData

java.lang.Object getProcessInstanceData()
Returns additional process instance data. In the case of Level 0 and Level 1 continuations this method will return null.

Returns:
Additional process instance data or null.

Sonic ESB API

Copyright © 2001-2012 Progress Software Corporation. All Rights Reserved.
HTML formatted on 13-Mar-2012.