Extending : Processor editor extension : Extending the Processor editor : Implementing a state at runtime
  
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:
public Object initializeFrom(Tag aTag) throws java.io.IOException, com.ibm.btt.base.DSEException
public void activate() throws DSEInvalidArgumentException, DSEProcessorException
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.
Sample of the implementation of the initializeFrom() method
Below is a sample of the implementation of the public Object initializeFrom(Tag aTag) throws java.io.IOException, com.ibm.btt.base.DSEException method.
This graphic is described in the surrounding text.
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.
A sample of the implementation of the activate () method
This graphic is described in the surrounding text.
Go up to
Extending the Processor editor