Using Custom Steps

Writing your own custom steps provides a server-side solution to navigation problems that are either too difficult or impossible for a task, recorded using the standard design-time workflow, to solve.

To write a custom step you must first create a step adapter class, using Java and Attachmate's server-side API, and then make it available to the design-time component. Once an adapter class as been written and saved to the proper location, you select the step adapter class from the list of all available step adapter classes and associate it with the converted step.

A step adapter class is a user-created class that is instantiated and run when the custom step is executed.

For detailed information on the server-side API, see Javadocs for Attachmate Interfaces.

There are five steps involved in creating and using a custom step.

Note To walk through a "real-life" example of a task that cannot be solved using the Task Builder for Screens standard workflow, see How to use Custom Steps and the Server-side API.
Creating and using a custom step
  1. Record a task using the standard procedure and save the project.

    When you record a task, remember that a complete task consists of transactions performed and information retrieved. A task is "complete" when the task endpoint has been reached and is marked. While you must navigate back to the beginning of your task, this "resetting" of the task should not contain any host interaction or perform any transactions.

    When using custom steps and the server-side API, just as in other tasks, you collect data, using the processData method, reset the task, and then navigate, using a transition action, to another screen. It is important to realize that if any task or screen data needs to be used for navigational purposes during a task reset this should be coded in the custom step transition method, and not in the processData method.

  2. Identify the step you want to convert and determine the needed result of your custom step, then write the step adapter class that will produce the correct navigation scenario in the development environment of your choice, and save it to the correct location. To aid in writing the step adapter class use Java and Attachmate's server-side API. See, the Related Topic, Javadocs for Attachmate Interfaces, for information on the server-side API.

    In order for step adapter classes to be available to the design-time component and show up in the available step adapter classes list they must be placed in the <Install Location>\Attachmate\EAI\recordings\<project name>\scripts\java\classes directory, where Install Location refers to the location you installed the designer and project name refers to the name of the current project.

    If your step adapter implementation has...
    Then
    A package associated with it The package directory structure needs to be manually created in the same directory.
    Any dependent classes They must also be placed in the same directory with the proper package structure in order that they can be used by Task Builder and deployed correctly. However, you only need to select the step adapter implementation since dependant classes are used and deployed automatically.
  3. Select the step you want to convert to a custom step and, from the Step menu, choose Advanced, then Convert Step to Custom Step.

    The Convert Step to Custom Step dialog box displays.

  4. Select the correct step adapter class from the list of available step adapter classes that you've created and saved in the <Install Location>\Attachmate\EAI\recordings\<project name>\scripts\java\classes directory. Choose OK.

    In the Task Step tree, the custom step icon is added to the selected step and it is marked as a custom step.

  5. There are properties associated with custom steps. To edit the Step Adapter class, choose a different class in the drop-down list of available adapter class implementations on the Custom Step Properties page.

    The other properties listed on the Custom Step Properties page are properties associated with standard task creation. For more information on step properties, see Task and Task Step Property Descriptions.

  6. If necessary to complete your custom navigation path, choose a new step destination.

  7. Following the standard workflow, test your completed task and generate your task interface objects.
Related Topics
Bullet Using Advanced Navigation, Overview
Bullet Configuring Your IDE to use Custom Steps
Bullet Javadocs for Attachmate Interfaces
Bullet How to use Custom Steps and the Server-side API
Bullet Task and Task Step Property Descriptions
  Attachmate