IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.automaton.html
Class DSEHtmlProcessor

java.lang.Object
  extended by com.ibm.btt.base.BTTProcessorNotifier
      extended by com.ibm.btt.automaton.DSEProcessor
          extended by com.ibm.btt.automaton.html.DSEHtmlProcessor
All Implemented Interfaces:
Executable, InterStateFormatEnabledProcessor, Processor, Cacheable, ProcessorNotifier, java.io.Externalizable, java.io.Serializable

This is a subclass of DSEProcessor that implements behavior specific to the
 HomeBanking HTML Client. This behaviour include supporting "virtual"
 processors (that is, processors which can be persisted with enough
 information so that they can be restored to the state they were in when they
 were persisted) and changing the default behavior of DSEProcessor so that it
 executes the state machine to its end. The changed default behavior consists
 of checking state types before they are processed, and suspending the
 processor for the page, and subflow states. In addition, this
 class adds support for a validator class. The validator validates the
 business data required for the workflow that the processor is implementing.

See Also:
Serialized Form

Field Summary
static java.lang.String ABORTING
          
Fields inherited from class com.ibm.btt.automaton.DSEProcessor
ABORTED, aProcessorStatusChangedListener, CHANGESTATE, CLEAN_EVENTS_QUEUE_ON_SWITCH, cleanQueueOnSwitch, COMPLETED, context, currentState, eventQueue, externalizer, INITIALIZED, NOT_INITIALIZED, processorId, processorName, RUNNING, stateTag, status, STATUSCHANGEEVENT, SUSPENDED, TERMINATEEVENT
 
Fields inherited from class com.ibm.btt.base.BTTProcessorNotifier
handlersList, name
 
Fields inherited from interface com.ibm.btt.automaton.Processor
COMPID
 
Constructor Summary
DSEHtmlProcessor()
          
Method Summary
 void abort()
          
Methods inherited from class com.ibm.btt.automaton.DSEProcessor
addProcessorStatusChangedListener, cleanEventQueue, clearKeyedCollection, externalizer, fireProcessorStatusChangedEvent, fireProcessorTerminatedEvent, getCurrentState, getCurrentStateType, getEventQueue, getExternalizer, getInitialStateTag, getProcessorId, getProcessorName, getRefServiceTags, getService, getStateTag, getStateTagList, getStatus, getTag, initialize, initializeKeyedCollectionValueFrom, isCacheable, isCleanQueueOnSwitch, readExternal, readExternal, readObject, removeExternal, resume, setCleanQueueOnSwitch, setContext, setCurrentState, setCurrentStateType, setEventQueue, setExternalizer, setProcessorId, setProcessorName, setStatus, setTag, suspend, terminate, toString, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.btt.base.BTTProcessorNotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
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.Processor
addHandler, getHandlersList, signalEvent
 
Methods inherited from interface com.ibm.btt.base.Cacheable
getName
 
Methods inherited from interface com.ibm.btt.base.Externalizable
getName, setName
 

Field Detail

HTML

public static final java.lang.String HTML
See Also:
Constant Field Values

CONSEQ_UNDEFINED

public static final java.lang.String CONSEQ_UNDEFINED
See Also:
Constant Field Values

CONSEQ_TRUE

public static final java.lang.String CONSEQ_TRUE
See Also:
Constant Field Values

CONSEQ_FALSE

public static final java.lang.String CONSEQ_FALSE
See Also:
Constant Field Values

CONSEQ_ERROR_PAGE

public static final java.lang.String CONSEQ_ERROR_PAGE
See Also:
Constant Field Values

XVALIDATION

public static final java.lang.String XVALIDATION
See Also:
Constant Field Values

PROCESSTIMEOUT

public static final java.lang.String PROCESSTIMEOUT
See Also:
Constant Field Values

DELEGATEVALASSESSMENT

public static final java.lang.String DELEGATEVALASSESSMENT
See Also:
Constant Field Values

CONSEQUENTIAL

public static final java.lang.String CONSEQUENTIAL
See Also:
Constant Field Values

ABORTING

public static final java.lang.String ABORTING
See Also:
Constant Field Values

parentSessionId

protected java.lang.String parentSessionId
Support for application session *


parentAppSessionId

protected java.lang.String parentAppSessionId
Support for application session *


prevActionContext

protected Context prevActionContext
Attribute for InterStateFormat support *


isFormatTag

protected Tag isFormatTag
Constructor Detail

DSEHtmlProcessor

public DSEHtmlProcessor()
DSEHtmlProcessor constructor.


DSEHtmlProcessor

public DSEHtmlProcessor(java.lang.String aName)
DSEHtmlProcessor constructor.

Parameters:
aName - java.lang.String

DSEHtmlProcessor

public DSEHtmlProcessor(java.lang.String aName,
                        java.lang.String aTID)
DSEHtmlProcessor constructor.

Parameters:
aName - java.lang.String
aTID - java.lang.String

DSEHtmlProcessor

public DSEHtmlProcessor(boolean mustRegister)
DSEHtmlProcessor constructor.

Parameters:
mustRegister - boolean
Method Detail

abort

public void abort()
           throws DSEProcessorException
Aborts the state machine.

Specified by:
abort in interface Processor
Overrides:
abort in class DSEProcessor
Throws:
DSEProcessorException

addElementsToTransitionContext

protected void addElementsToTransitionContext(Context tcContext,
                                              java.lang.String[] elementsToAdd,
                                              int size)
                                       throws DSEInvalidRequestException
Adds the DataElements whose names are in elementsToAdd to the transition context keyed collection

Parameters:
KeyedCollection - - The transition context kColl
String - [] - The names of the elements to be added in the kColl
int - - The number of elements to be added
Throws:
DSEInvalidRequestException

changeState

public void changeState(java.lang.String newState)
                 throws DSEProcessorException
This is equivalent to calling changeState(String, false, null).

Overrides:
changeState in class DSEProcessor
Parameters:
newState - java.lang.String
Throws:
DSEProcessorException

changeState

public void changeState(java.lang.String newState,
                        boolean ignoreEntryActions)
                 throws DSEProcessorException
This is equivalent to calling changeState(String, false, TransitionDescriptor), with a transition descriptor object that has its ignoreEntryActions flag set to the boolean argument.

Specified by:
changeState in interface Processor
Overrides:
changeState in class DSEProcessor
Parameters:
newState - java.lang.String
ignoreEntryActions - boolean
Throws:
DSEProcessorException

changeState

public void changeState(java.lang.String newStateName,
                        boolean activate,
                        java.lang.String transitionName)
                 throws DSEProcessorException
This method is equivalent to calling changeState(String, boolean, TransitionDescriptor). The transition descriptor argument is obtained from the current state of the processor, using the transition name supplied as argument to this method.

Parameters:
newStateName - java.lang.String
ignoreEntryActions - boolean
transitionName - java.lang.String
Throws:
DSEProcessorException

changeState

public void changeState(java.lang.String newStateName,
                        boolean activate,
                        TransitionDescriptor transition)
                 throws DSEProcessorException
Attempts to change the current state being managed by the state machine to the one specified by the state name argument. The following apply:
  • The ignoreEntryActions attribute of the new state is set to correspond to the ignoreEntryActions attribute of the supplied transition.
  • For HTML states, the inputMapFormat attribute of the supplied transition is copied (if present), into the state.
  • The consequentiality of the state specified by the state name argument and the transition passed in as an argument are used to determine the consequential status of the processor. State and transition consequentiality are attributes that define whether the processor will be placed in a consequential state upon traversal of the state or transition. Consequentiality for a state or transition can take one of three values: undefined, true, or false. See com.ibm.btt.automaton.html.DSEHtmlState for a formal definitions.

    If the state specified by the state name argument defines consequentiality (true or false), then its value for consequentiality is used to determine the consequential status of the processor. If it does not but the transition does, the transition's consequentiality is used to determine the processors consequential status. If the processor is consequential and the state or transition has a status of false, the processor is removed from the consequential state. If the processor is not consequential, and the state or transition has a status of true, the processor is placed into a consequential state. As mentioned above, the transitions values are only used if the state has a value of undefined for its consequentiality.

    If the activate argument is true, the new state is activated upon completion of this method.

    Parameters:
    newStateName - java.lang.String
    activate - boolean
    transition - com.ibm.btt.automaton.TransitionDescriptor
    Throws:
    DSEProcessorException

checkDelValidationAssessmentFlag

protected void checkDelValidationAssessmentFlag(HtmlTransitionDescriptor transition,
                                                java.lang.String transitionName,
                                                java.lang.String sessionID)
Checks if the 'delegateValidationAssessment' parameter has been dynamically set by the JSP and if so updates the html transition attribute with the proper value

Parameters:
HtmlTransitionDescriptor - - The transition
String - - the transition name
String - - the session ID

doDataMapping

protected void doDataMapping(Tag formatTag,
                             Context sourceCtx,
                             Context targetCtx)
                      throws DSEException
This utility method maps data from the source context to the target context using the supplied DataMapperFormat.

Parameters:
format - com.ibm.btt.base.DataMapperFormat
sourceCtx - com.ibm.btt.base.Context
targetCtx - com.ibm.btt.base.Context
Throws:
DSEException

checkLegalSwitch

public boolean checkLegalSwitch(java.lang.String stateName)
This utility method returns a boolean indicating whether it is legal for the state machine to switch to state supplied as argument. Legality is determined thus: If the processor is in a consequential state, and an attempt is made to switch to a state that does not define consequentiality, then legality is set to false. All other cases set legality to true ;

Parameters:
stateName - java.lang.String
Returns:
boolean

checkLegalSwitch

public boolean checkLegalSwitch(java.lang.String stateName,
                                java.lang.String eventName)
This utility method returns a boolean indicating whether it is legal for the state machine to switch to state supplied as argument. Legality is determined thus: If the processor is in a consequential state, and an attempt is made to switch to a state that does not define consequentiality, then legality is set to false. All other cases set legality to true ;

Parameters:
stateName - java.lang.String
eventName - java.lang.String
Returns:
boolean

checkLegalSwitch

protected boolean checkLegalSwitch(State state,
                                   TransitionDescriptor transition)
This utility method returns a boolean indicating whether it is legal for the state machine to switch to state supplied as argument. Legality is determined thus: If the processor is in a consequential state, and an attempt is made to switch to a state that does not define consequentiality, then legality is set to false. All other cases set legality to true ;

Parameters:
state - com.ibm.btt.automaton.State
transition - com.ibm.btt.automaton.TransitionDescriptor
Returns:
boolean

close

public void close()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
Unchains the context and releases the eventQueue object.

Specified by:
close in interface Processor
Overrides:
close in class DSEProcessor
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

execute

public void execute()
             throws DSEInvalidArgumentException,
                    DSEProcessorException
Serves as an entry point for execution of the state machine. This method also supports the suspension of the state machine when states of a certain type are encountered during processing.

Specified by:
execute in interface Executable
Overrides:
execute in class DSEProcessor
Throws:
DSEInvalidArgumentException
DSEProcessorException

execute

public void execute(java.lang.String eventName)
             throws DSEInvalidArgumentException,
                    DSEProcessorException
Starts executing the HTML processor. An event is dispatched to the state machine corresponding to the supplied event name. This event is essentially the entry event used by the state machine to begin processing.

Throws:
DSEInvalidArgumentException
DSEProcessorException

getConseqErrorResponse

public java.lang.String getConseqErrorResponse()
Returns the consequential error response defined for this processor.

Returns:
java.lang.String

getParentAppSessionId

public java.lang.String getParentAppSessionId()
Gets the parentAppSessionId

Returns:
Returns a String

getParentId

public java.lang.String getParentId()
Returns the parent id attribute of this processor.

Returns:
java.lang.String

getParentSessionId

public java.lang.String getParentSessionId()
Gets the parentSessionId

Returns:
Returns a String

getProcessorTimeout

public java.lang.Long getProcessorTimeout()
Returns the specified timeout in miliseconds for the processor

Returns:
java.lang.Lang

getStateInstance

protected State getStateInstance(State state,
                                 Tag aTag)
                          throws java.lang.Exception
This is a utility method used to obtain an appropriate State instance for the supplied tag. The class of the supplied State argument is used if a class instance cannot be obtained in any other way.

Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
com.ibm.btt.automaton.State
Throws:
java.lang.Exception

getTransitionContext

public Context getTransitionContext(HtmlTransitionDescriptor transition,
                                    java.lang.String transitionName,
                                    java.lang.String sessionID)
                             throws DSEInvalidRequestException
Gets the TC if any and updates it with the data elements whose names are stored in the TCInfo of the given transactionName or creates a new one.

Parameters:
HtmlTransitionDescriptor - - The transition
String - - the transition name
String - - the session ID
Returns:
the transition context
Throws:
DSEInvalidRequestException

getXValidator

public ProcessorXValidate getXValidator()
Returns the validator attribute for this class.

Returns:
com.ibm.btt.automaton.html.ProcessorXValidate

indexOfInteger

public int indexOfInteger(java.lang.String address)
This is a utility method used to obtain a number inside the given string. If this method finds one, the method returns its index in the String. If the method does not find one, the method returns -1. The number is supposed to be delimitated by dots ("asas.123.dfg.dfg"). If there is more than one number, the method returns the index of the first one.

Parameters:
address - java.lang.String
Returns:
int

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Initializes this processor object's state from externalized data definitions.

Overrides:
initializeFrom in class DSEProcessor
Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException
DSEException
DSEProcessorException

isSystemValue

protected boolean isSystemValue(java.lang.String valueName)
This utility method returns true if the string value passed represents the name of a HTML client system variable, which is defined as one prefixed with dse_.

Parameters:
valueName - java.lang.String
Returns:
boolean

reinitialize

public void reinitialize()
Reinitializes THIS object. It should be called immediately after being extracted from the cache.

Specified by:
reinitialize in interface Cacheable
Overrides:
reinitialize in class DSEProcessor

removeElementsFromTransitionContext

protected void removeElementsFromTransitionContext(KeyedCollection tcContextKColl,
                                                   java.lang.String[] elementsToRemove,
                                                   int size)
Removes the DataElements whose names are in elementsToAdd from the transition context keyed collection

Parameters:
KeyedCollection - - The transition context kColl
String - [] - The names of the elements to be removed from the kColl
int - - The number of elements to be removed

getPrevActionContext

public Context getPrevActionContext()
Returns previous action context

Specified by:
getPrevActionContext in interface InterStateFormatEnabledProcessor

getInterStateFormatTag

public Tag getInterStateFormatTag()
Returns inter-state format tag

Specified by:
getInterStateFormatTag in interface InterStateFormatEnabledProcessor

getContext

public Context getContext()
Return the current contect using by this processor

Specified by:
getContext in interface InterStateFormatEnabledProcessor
Specified by:
getContext in interface Processor
Overrides:
getContext in class DSEProcessor
Returns:
com.ibm.btt.base.Context

getProcessorContext

public Context getProcessorContext()
Returns the processor context


setPrevActionContext

public void setPrevActionContext(Context paContext)
Set the previous context from the previous action

Specified by:
setPrevActionContext in interface InterStateFormatEnabledProcessor

setInterStateFormatTag

public void setInterStateFormatTag(Tag formatTag)
Set the inter state format tag

Specified by:
setInterStateFormatTag in interface InterStateFormatEnabledProcessor

setConseqErrorResponse

public void setConseqErrorResponse(java.lang.String newConseqErrorResponse)
Sets the consequential error response for this processor object.

Parameters:
newConseqErrorResponse - java.lang.String

setParentAppSessionId

public void setParentAppSessionId(java.lang.String parentAppSessionId)
Sets the parentAppSessionId

Parameters:
parentAppSessionId - The parentAppSessionId to set

setParentId

public void setParentId(java.lang.String newParentId)
Sets the parentId property of this processor object.

Parameters:
newParentId - java.lang.String

setParentSessionId

public void setParentSessionId(java.lang.String parentSessionId)
Sets the parentSessionId

Parameters:
parentSessionId - The parentSessionId to set

setProcessorConsequentialState

protected void setProcessorConsequentialState(State state,
                                              java.lang.String consequentiality)
This utility method changes the status of the processor depending on the consequentiality of the state and the supplied consequentiality argument.

Parameters:
state - com.ibm.btt.automaton.State
consequentiality - java.lang.String

setProcessorTimeout

public void setProcessorTimeout(java.lang.Long newProcessorTimeout)
Sets the specified time to the processor's timeout in miliseconds.

Parameters:
newParentId - java.lang.Long

setXValidator

public void setXValidator(ProcessorXValidate newXValidator)
Sets the validator attribute of this processor object.

Parameters:
newXValidator - com.ibm.btt.automaton.html.ProcessorXValidate

stateReturnsControl

public static boolean stateReturnsControl(State state)
This method is a utility method for HTML processors and determines whether the state supplied to it as argument is of a type for which the processor will suspend execution of the state machine. It returns a boolean indicating whether this should occur or not.

Parameters:
state - com.ibm.btt.automaton.State
Returns:
boolean

updateContext

public void updateContext(Context context)
                   throws DSEObjectNotFoundException,
                          DSEException
Updates the processor context by copying values by name from the supplied context into the processor context.

Parameters:
context - com.ibm.btt.base.Context
Throws:
DSEObjectNotFoundException
DSEException

updateContext

public boolean updateContext(KeyedCollection coll)
                      throws DSETypeException,
                             DSEObjectNotFoundException,
                             DSEInvalidArgumentException
Validates the data received from client and copies it into the processor context. The validation includes the field validation and the cross validation. If a transition context has been defined, only the sent elements that appear in this context are copied.

Parameters:
coll - com.ibm.btt.base.KeyedCollection
Returns:
boolean
Throws:
DSETypeException
DSEObjectNotFoundException
DSEInvalidArgumentException

updateContext

public boolean updateContext(KeyedCollection coll,
                             java.lang.String sessionID)
                      throws DSETypeException,
                             DSEObjectNotFoundException,
                             DSEInvalidArgumentException
Validates the data received from client and copies it into the processor context. The validation includes the field validation and the cross validation. If a transition context has been defined, only the sent elements that appear in this context are copied.

Parameters:
coll - com.ibm.btt.base.KeyedCollection
Returns:
boolean
Throws:
DSETypeException
DSEObjectNotFoundException
DSEInvalidArgumentException

validate

public void validate(KeyedCollection coll,
                     Context context)
              throws DSEObjectNotFoundException,
                     DSETypeException,
                     DSEInvalidArgumentException
Performs basic validation of the business data passed in the keyed collection. Basic validation is a copy-by-name into the supplied context. Extensive validation is only possible when using typed data. With typed data, the data element validator can verify the data value before it is copied into the context.

Parameters:
coll - com.ibm.btt.base.KeyedCollection
context - com.ibm.btt.base.Context
Throws:
DSEException
DSEObjectNotFoundException
DSETypeException
DSEInvalidArgumentException

validateFromTransition

public void validateFromTransition(KeyedCollection coll,
                                   Context context)
                            throws DSEException
Performs basic validation of the business data passed in the keyed collection. Basic validation is a copy-by-name into the supplied context. Extensive validation is only possible when using typed data. With typed data, the data element validator can verify the data value before it is copied into the context.

Parameters:
coll - com.ibm.btt.base.KeyedCollection
context - com.ibm.btt.base.Context
Throws:
DSEException

xValidate

public void xValidate(Context context,
                      java.lang.String transitionName)
               throws java.lang.Exception
Uses the processor's defined validator class to perform validation of data and stores any exceptions thrown in the course of validation in the context heirarchy to be utilized by the HomeBanking toolkit.

Parameters:
context - com.ibm.btt.base.Context
transitionName - java.lang.String
Throws:
java.lang.Exception

clear

public void clear()
release the the references of other objects, Some of these objects are candidates for garbage collection


IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009