Creating an operation

About this task
When creating an operation, you can either create a global operation or a local operation. Do the following steps to create a new operation:
  1. Create the operation classes:
    • To create a global operation class, do the following:
      1. Create a new class extending com.ibm.btt.base.BTTOperation, which is located in bttcore.jar. See the following screen capture:
        Screen capture showing how to create a new class
      2. Open btt.xml file, and find the operation section. Add the following code to the classtable configuration:
        field id="newOperation" value="package.NewOperation" /
      3. 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 create a local operation class, you can create a new class extending com.ibm.btt.base.BTTOperation, which is located in bttcore.jar.
  2. Create operation:
    After you created the operation classes, double-click the transaction to open the Transaction Editor. In the Operation tab, right-click anywhere in the Operation Editor area, and select New Child > Operation. The Operation Creation Dialog opens. There are three options, as shown in the following screen capture:
    Screen capture showing how to define an operation
    • Choose operation class from global BTT definition:
      1. Click Browse to select the global operation class you created in Creating a global operation class. The following screen capture shows the Select Global Operation dialog box:

        Screen capture of the Select Global Operation dialog box

      2. Click OK, and the Tag Name and Class Name are automatically displayed in the Operation Creation Dialog as shown in the following screen capture:

        Screen capture of the Operation Creation Dialog

      3. Click OK, and the global operation is created.
        Screen capture of the global Operation
        You can modify the properties of the operation in the Detailed Information section:
        • In the Id field, enter the value of the Id attribute.
        • In the Context field, click to select the Context. The context should be predefined. For information about global and local context, see Creating a context.
        • In the XVal field, click to select the validation class. The validation class must be predefined. For information about how to define validation class, see Defining the XVal property of an operation.
    • Choose operation class from local class path
      1. Click Browse to select the local operation class you created in Creating a local Operation class. The following screen capture shows the Select Class dialog box:

        Screen capture of the Select Class dialog box

      2. Click OK, and the Tag Name and Class Name are automatically displayed in the Operation Creation Dialog.

      3. Click OK, the local operation is created as shown in the following screen capture:
        Screen capture of the local Operation

        You can modify the properties of the operation in the Detailed Information section.

    • Create New Class

      The Create New Class option is provided in case you have no operation class created before or you want to create a new operation Class. By default the operation class created by this wizard is local operation.

      1. Click Create, and a dialog box pops up asking you to create a new Java™ class. Enter the fields as appropriate. Following is a screen capture:

        Screen capture of creating a new class

      2. Click Finish. The Tag Name and Class Name are automatically displayed in the Operation Creation Dialog as shown in the following screen capture:

        Screen capture of the Operation Creation Dialog

      3. Click OK, and then the new operation is created. You can modify the properties of the operation in the Detailed Information section.
  3. After you created the operation, right-click it in the Operation Editor, and you can add children to the operation. Following is the screen capture:
    1. Click refFormat to create a reference formatter for the operation. In the RefId filed of the Detailed Information section, click to select a global or local formatter; in the Name filed, enter the name of this refFormat.
    2. Click opStep to create an operation step for the operation. For more information about operation step, see Creating operation steps for an operation.
    3. Click iniValue to create an initial value for the operation. In the Detailed Information section, enter the name and value.