IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

Implementing a state at runtime

When the defined flow processor is executed at runtime, each state in the flow is represented as a Java object. When the flow enters a state, the Java object that represents the state is initiated and activated by a processor. After creating a palette object and the mapping file of the palette object, technical developers miust implement a Java class corresponding to this object. The class should extend DSEState or its derive classes such as DSEHtmlState.

To implement the logic of a state, technical developers must override the following two methods:

The public Object initializeFrom(Tag aTag) throws java.io.IOException, com.ibm.btt.base.DSEException method is invoked when a processor initializes the state from a tag. Because the state might may have several properties, technical developers must initiate these properties from a tag when the state is initiated.

Figure 1 shows a sample of the implementation of the public Object initializeFrom(Tag aTag) throws java.io.IOException, com.ibm.btt.base.DSEException method.
Figure 1. Sample of the implementation of the initializeFrom() method

The public void activate() throws DSEInvalidArgumentException, DSEProcessorException method is invoked when a processor active the state. Technical developers must to override this method to implement state specific logic.

Figure 2 shows a sample of the implementation of the public void activate() throws DSEInvalidArgumentException, DSEProcessorException method.
Figure 2. A sample of the implementation of the activate () method.


Feedback