Generating Service Bean Interface Objects

Before you can generate Java service bean task interface objects, you will need to install Apache ANT. Make sure to add to the system path the \bin folder under the ANT install location. Also, you will need to create a system environment variable for the Java home folder named JAVA_HOME.

When you generate a service bean, Java classes are created for each task in a folder named for the task file from which the bean was generated. The default location for the folder created is:

Continued linetask_file_name

A Java package name consists of descriptive parts, with a period between each part. Typically, the first part of the package name indicates a logical grouping for similar packages. The remaining parts describe the package, or what is contained in the package. The package name also represents the directory structure of the package.

In Task Builder, when you specify a package name, any class file created is given a fully qualified name by appending the name of the task file used to generate the bean to the package name specified. For example, if you had a task file named StockSale, and a bean generated from that file, and you specified a package name of com.attachmate.tasks, the class file created would be named com.attachmate.tasks.StockSale.

If a task file contains more than one task, a separate Java class would be generated for each task. The names of the tasks would be identical except for the last part, which would reflect the name of the task for which it is created. For instance, if the task file contained two tasks, named Task1 and Task2, the classes created would be named com.attachmate.tasks.Task1 and com.attachmate.tasks.Task2.

Caution Each time you generate a task interface object, the files and folders created from previously generated objects are deleted, and a new folder is created for the new interface objects. To save the files generated, you must move or copy them to a different location before generating another interface object. Only task files and task bean files can be exported from Task Builder using the Publish/Export capability, and you can export only those task bean files most recently generated.
To generate a service bean interface object
  1. Confirm the configuration of the Options settings to make sure that they match the type of beans you want to generate.

  2. Verify that your Java compilation environment has been set in Task Builder, by choosing, from the Tools menu, Options, then choose the Compiling tab.

    Locations for Sun Java 2 SDK (JDK) and Apache ANT build should both be set.

  3. Confirm that the system environment variable JAVA_HOME is set to the location matching the Java.home setting on the Compiling page of the Options dialog box.

    By default, this value is set as follows:


  4. (Optional) To specify a default value for the package name, in Task Builder, from the Tools menu, select Options, then from the Options dialog box select Service Beans and click Properties.

  5. Specify a package name for the bean.

    Do not use spaces in the name.

    Note To use a different package name each time you generate a task interface object, specify the name when you select the bean type to generate.
  6. Select the task file that contains the inputs and outputs that you want to implement in your generated task, and then click Next.

  7. Select Service Beans.

    You can optionally generate other types of interface objects at the same time. If you want to generate only a service bean, clear any other types of interface objects selected.

    Interface object types are automatically selected for option types that are configured from the Generate page of the Options dialog box.

  8. When you have finished your selections, click the Generate button.

    The Generation Results dialog box displays, indicating the results of the generation process, and listing the files generated in the following directories:

    • install_directory\EAI\IMSTaskDesigner\ws\output\
      Continued lineTask_file_name\ServiceBeanTarget\

    • install_directory\EAI\IMSTaskDesigner\MetaData\

    Note The service bean package is not automatically compiled by Task Builder. To compile the bean, open a Command Prompt window.

  9. Change to the following folder:

    Continued lineServiceBeanTarget\

  10. Type ant and then press ENTER.

    The following folder is created:

    Continued lineservicebean\Service_bean_name\Task_file_name

    This folder contains a service bean class file named Task_file_nameServiceBean.class, as well as subfolders for the input and output class files used to generate the service bean class.

Related Topics
Bullet Creating Task Files
Bullet Creating a Task Definition
Bullet Generating Task Bean Interface Objects
Bullet Using Apache Axis Web Services