IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.automaton.ext
Class DSEOperationState

java.lang.Object
  extended by com.ibm.btt.base.DSEHandler
      extended by com.ibm.btt.automaton.DSEState
          extended by com.ibm.btt.automaton.ext.DSEBaseState
              extended by com.ibm.btt.automaton.ext.DSEOperationState
All Implemented Interfaces:
FormatEnabledState, State, Handler, OperationRepliedListener, Traceable, java.io.Externalizable, java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
DSESyncProcState

public class DSEOperationState
extends DSEBaseState
implements OperationRepliedListener

This class is an extension of the DSEState. It implements a state that is related to an operation. When the operation state is reached, the Automaton looks for the associated operation (which is defined in the typeIdInfo attribute) chains it to the appropriate context, and executes it.

The operation has the responsibility of firing an event when it ends. This event contains a parameter named "dse_exitEventName". This parameter contains the name of the event that the state machine uses to change to the next state. The operation context is chained to the processor context, but the data sharing should be done using the map formats.

See Also:
Serialized Form

Field Summary
protected  Operation operation
          Operation which this state will execute.
protected  Semaphore operationRepliedSemaphore
          Semaphore where the execution waits until the operation raises an operationRepliedEvent.
protected  boolean usingProcessorCtx
          usingProcCtx means that the op has no ctx defined, so the proc ctx is used instead
 
Fields inherited from class com.ibm.btt.automaton.ext.DSEBaseState
EXIT_EVENT_NAME, inputFormatTag, outputFormatTag
 
Fields inherited from class com.ibm.btt.automaton.DSEState
ABORT_PROCESS, actionHandlers, CHANGE_STATE, CONDITIONS, CONTINUE, DEFAULT_TYPE, done, ENTRY_ACTIONS, entryActionsTags, EXECUTE_ACTION_AND_CHANGESTATE, EXIT_ACTIONS, exitActionsTags, exitEventName, FINAL_TYPE, ignoreEntryActions, INITIAL_TYPE, name, PAGE_TYPE, pqThread, processor, runningModeFlag, sharedNotifiers, SKIP_ACTION, SKIP_ALL_ACTIONS, SKIP_CONDITIONS, SUBFLOW_TYPE, suspendedThread, SUSPENDTIME, tag, transitions, TRANSITIONS, type, TYPE, TYPE_ID_INFO, typeIdInfo
 
Constructor Summary
DSEOperationState()
           
 
Method Summary
protected  void afterActivate()
          The dispose logic after state activation, here to release resources used by this state.
protected  void beforeActivate()
          The preparation for state activation, it will be invoked after entry actions and before input mapping.
 boolean chainOrAssignContext(Operation theOperation)
          Verifies whether the operation has a context.
protected  void doActivate()
          Activates an operation state.
protected  Context getContext()
          Get the context of state which will be used by input and output mapping.
 Operation getOperation()
          Returns the operation attribute of this class.
 void handleOperationRepliedEvent(OperationRepliedEvent event)
          Signals the semaphore when the state's activate method is waiting for the operation end.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes the state of this object from externalized data.
protected  Operation readOperation()
          Gets the operation from the operation name stored in the typeIdInfo state's attribute.
 void setOperation(Operation newOperation)
          Sets the input format property.
 
Methods inherited from class com.ibm.btt.automaton.ext.DSEBaseState
activate, changeProcessorState, doDataMapping, fireDSEChangeStateEvent, getInputFormatTag, getOutputFormatTag, processEventQueue, processQueue, setInputFormatTag, setOutputFormatTag, signalEvent
 
Methods inherited from class com.ibm.btt.automaton.DSEState
abort, addHandlersForAction, dispatchEvent, doEntryActions, doExitActions, externalizer, fireDSEChangeStateEvent, fireDSEChangeStateEvent, fireDSEChangeStateEvent, getEntryActions, getExitActions, getGuardConditionResult, getInstanceOfAction, getName, getProcessor, getTag, getTraceMessage, getTransitions, getType, getTypeIdInfo, isIgnoreEntryActions, isRunningModeFlag, readExternal, readExternal, removeExternal, removeHandlersForAction, removeHandlersForAction, resume, setEntryActions, setExitActions, setIgnoreEntryActions, setName, setProcessor, setTag, setTransitions, setType, setTypeIdInfo, subscribeToShareNotifiers, suspend, terminate, toString, toStrings, toTags, unsubscribeToSharedNotifiers, writeExternal, writeExternal
 
Methods inherited from class com.ibm.btt.base.DSEHandler
handleEvent, handleEvent, stopHandlingEvent, stopHandlingEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.automaton.State
abort, getEntryActions, getName, getProcessor, getTransitions, getType, getTypeIdInfo, resume, setEntryActions, setIgnoreEntryActions, setName, setProcessor, setTransitions, setType, setTypeIdInfo, suspend, terminate
 
Methods inherited from interface com.ibm.btt.base.Handler
dispatchEvent, handleEvent, handleEvent, stopHandlingEvent, stopHandlingEvent
 

Field Detail

operationRepliedSemaphore

protected Semaphore operationRepliedSemaphore
Semaphore where the execution waits until the operation raises an operationRepliedEvent.


operation

protected Operation operation
Operation which this state will execute.


usingProcessorCtx

protected boolean usingProcessorCtx
usingProcCtx means that the op has no ctx defined, so the proc ctx is used instead

Constructor Detail

DSEOperationState

public DSEOperationState()
Method Detail

beforeActivate

protected void beforeActivate()
                       throws DSEInvalidArgumentException,
                              DSEProcessorException
Description copied from class: DSEBaseState
The preparation for state activation, it will be invoked after entry actions and before input mapping.

Overrides:
beforeActivate in class DSEBaseState
Throws:
DSEInvalidArgumentException
DSEProcessorException

doActivate

protected void doActivate()
                   throws DSEProcessorException
Activates an operation state. The operation must fire an event and this class listens for it. The event raised from the operation must contain event information that is used to change the state.

This method waits until this event is received. It then tries to raise the event created from the information received from the operation. The state processes this event and put it on the queue. Processing the event queue provokes a state change.

Specified by:
doActivate in class DSEBaseState
Throws:
DSEProcessorException

afterActivate

protected void afterActivate()
                      throws DSEProcessorException
Description copied from class: DSEBaseState
The dispose logic after state activation, here to release resources used by this state. It will be invoked after output mapping and before navigate to next state.

Overrides:
afterActivate in class DSEBaseState
Throws:
DSEProcessorException

getContext

protected Context getContext()
Description copied from class: DSEBaseState
Get the context of state which will be used by input and output mapping.

Specified by:
getContext in class DSEBaseState
Returns:

chainOrAssignContext

public boolean chainOrAssignContext(Operation theOperation)
                             throws DSEProcessorException
Verifies whether the operation has a context. If it does not, this method assigns the context identified the linkContextTo property. If the operation already has a context, this method chains the operation context to the linkContextTo context. If the method assigns the context, this method returns true.

Parameters:
thisOp - com.ibm.btt.base.Operation
contextName - java.lang.String
Returns:
boolean - True if the context was assigned
Throws:
DSEProcessorException

getOperation

public Operation getOperation()
Returns the operation attribute of this class.

Returns:
com.ibm.btt.base.Operation

handleOperationRepliedEvent

public void handleOperationRepliedEvent(OperationRepliedEvent event)
Signals the semaphore when the state's activate method is waiting for the operation end. This method must get the name of the event that will be used to change state from the event received.

Specified by:
handleOperationRepliedEvent in interface OperationRepliedListener
Parameters:
event - com.ibm.btt.base.OperationRepliedEvent

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Initializes the state of this object from externalized data. This extension only adds the map formats to what the parent method does.

Specified by:
initializeFrom in interface State
Overrides:
initializeFrom in class DSEState
Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException
DSEException

readOperation

protected Operation readOperation()
                           throws DSEInvalidArgumentException
Gets the operation from the operation name stored in the typeIdInfo state's attribute.

Parameters:
operationName - java.lang.String
Returns:
com.ibm.btt.base.Operation
Throws:
DSEInvalidArgumentException - The exception description.

setOperation

public void setOperation(Operation newOperation)
Sets the input format property.

Parameters:
newOperation - com.ibm.btt.base.Operation

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011