About this task
To extend the processor state and its property, do the following:
- Create a new class extending com.ibm.btt.automaton.DSEState, which is
located in bttcore.jar.
- Add bttcore.jar to the build path of your project:
- Right-click your project, and select . The New Java™ Class
dialog box pops up. In the Package field, click Browse to
select a package. In the Name field, enter the name
of this new class. In the Superclass field, enter com.ibm.btt.automaton.DSEState.
Click Finish. The class is created. See the following
screen capture:
- Open btt.xml file, and find the processors section and add the following
code to the classtable configuration:
field id="newState" value="package.NewState" /
Note: By default the btt.xml file is located in $D(RAD)\pluginscom.ibm.btt.tools.transaction.dominate_7.0\config.
You can also configure the btt.xml using the Deployment Description Editor
tool. For more information, see .
- If your Transaction Editor is opened before you define the extensions,
right-click any blank space in the editor and select Reload BTT
Global Settings in the pop-up menu so that your changes can be
applied.
- To extend the property of the processor state, add the following code
to the class you created:
import com.ibm.btt.annotation.ATTR;
@ATTR( { "newProperty1#String#REQUIRED","newProperty2#String#IMPLIED"})
where:- newProperty1 is the property name;
- String is the property type;
- REQUIRED refers to if the property is required or implied.
- By default, the properties of the parent class are extended. If you do
not want to extend the properties of the parent class, you can add the configuration
as follows: @EXTEND("no").
Results
Following is the code sample after you extend the processor state
and its property:
package btt;
import com.ibm.btt.automaton.DSEState;
import com.ibm.btt.annotation.ATTR;
@ATTR( { "newProperty1#String#REQUIRED","newProperty2#String#IMPLIED"})
public class myState extends DSEState {
}
And the Properties view is also updated to reflect your changes.
The following screen capture shows the Properties view after you add two new
properties to the :