Running an ODA

At run time, running an ODA involves the following components:

Figure 54 shows the components of the ODA runtime architecture.

Figure 54. Object Discovery Agent Architecture


To generate the business object definitions, the ODA must take the following steps:

  1. Obtain values for the ODA configuration properties (such as user name and database type) that the ODA requires to connect to the data source (such as an application, database, or filesystem).
  2. Use these configuration properties to connect to the data source.
  3. Obtain the list of source nodes for which business object definitions are to be created.
  4. Discover the requirements for the data-source entity underlying the source node (as defined by an application, database table, filesystem, or DTD).
  5. Generate business object definitions that meet the requirements of the WebSphere business integration system and the component that processes the business object, and return the business object definitions to users.

Note:
In addition to business object definitions, an ODA can also generate files as content. For more information, see Generating content.

Table 18 summarizes the steps in the running of an ODA and the steps in Business Object Wizard that initiate them.


Table 18.

Running the Object Discovery Agent
Task Step in Business Object Wizard For more information
1. Select the desired ODA to start Step 1: Select Agent Selecting the ODA
2. Obtain the ODA configuration properties, including those that describe the data source to open. Step 2: Configure Agent Obtaining ODA configuration properties
3. Obtain the source data for which to generate the ODA content. Step 3: Select Source Selecting and confirming source data
4. Confirm the source data that you have selected. Step 4: Confirm Source Nodes Selecting and confirming source data
5. Generate the business object definitions. Step 5: Generating Business Objects Generating content


Business Object Properties Obtaining business-object properties
6. Save the business object definitions. Step 6: Save Business Objects Saving content

Selecting the ODA

When users choose the File > New Using ODA Business Object Designer invokes Business Object Wizard to run the ODA. Step 1 of Business Object Wizard displays the Select Agent dialog box, which provides graphical access to all available Object Discovery Agents. From this dialog box, users select the ODA to run.

Business Object Wizard connects to this ODA with the following steps:

Note:
An ODA must already be started for Business Object Wizard to list it as an ODA available to run. For more information, see Before using an ODA.

For more information on how to create the ODA class, see Extending the ODA base class.

Obtaining ODA configuration properties

Step 2 of Business Object Wizard displays the Configure Agent dialog box, which shows the ODA's configuration properties. Configuration properties are those properties that the ODA needs to be able to begin running. The ODK API represents a configuration property as an agent-property (AgentProperty) object. In this step, the wizard displays the configuration properties, allows you to update them, and then writes the user-initialized properties into the ODA runtime memory.

Figure 55. Configure Agent (Step 2) of Business Object Wizard


As Figure 55 shows, Business Object Wizard takes the following actions:

  1. Obtains the configuration properties from the selected ODA and displays them in the Configure Agent dialog box.

    To obtain the configuration properties from the ODA, the wizard calls the getAgentProperties() method, which is defined in the ODA base class, ODKAgentBase2. This method is an abstract method that the ODA developer must implement as part of the ODA class. It returns the ODA's configuration properties to Business Object Wizard as an array of AgentProperty objects. These configuration properties can include the names, types, any valid values, descriptions, input restrictions, and any default values.

    In addition to the configuration properties that getAgentProperties() provides, Business Object Wizard always provides a set of standard configuration properties, which are common to all ODAs:

    For more information, see Obtaining configuration properties.

  2. From the Configure Agent dialog box, accepts entered values or changes for the configuration properties. The wizard sends the user-initialized configuration properties to the ODA.

    Business Object Wizard saves these properties in the ODA runtime memory. Within the ODA, you can access these properties through an instance of the ODKUtility class, which provides the getAgentProperty() and getAllAgentProperties() methods for this purpose.

  3. Initializes the ODA's metadata, which provides information about the ODA and its capabilities.

    After it calls getAgentProperties(), Business Object Wizard calls the getMetaData() method of the ODA base class, ODKAgentBase2. This method is an abstract method that the ODA developer must implement as part of the ODA class. It returns an initialized AgentMetaData object that contains the ODA metadata.

  4. Initializes the ODA based on the user-initialized startup properties.

    To initialize the ODA, the wizard calls the init() method of the ODA base class, ODKAgentBase2. This method is an abstract method that the ODA developer must implement as part of the ODA class. It performs initialization tasks such as resource allocation and creating a connection to the data source.

This chapter provides the following information on how to implement the methods involved in the initialization of an ODA:

Initialization method For more information
getAgentProperties() Obtaining configuration properties
getMetaData() Initializing ODA metadata
init() Initializing the ODA start

Selecting and confirming source data

Step 3 of Business Object Wizard displays the Select Source dialog box, which displays the source nodes of the data source. The source nodes are arranged in the source-node hierarchy. Each source node is the name of an object that the ODA has "discovered" in the data source. It can either be expanded to display other child nodes or selected for generation into content. Users can expand this source-node hierarchy to choose objects in the data source for conversion to content. For information, see Moving through the source-node hierarchy..

In Step 3, the wizard takes the following actions:

  1. Obtains the source-node hierarchy from the selected ODA and displays it top level in the Select Source dialog box.

    To obtain the source-node hierarchy, the wizard calls the getTreeNodes() method of the IGeneratesBoDefs interface. The ODA developer must implement this method as part of the ODA class's implementation of the IGeneratesBoDefs interface. It searches the data source to "discover" source nodes and returns these source nodes to Business Object Wizard as an array of TreeNode objects. When users expand a node for the first time, the wizard calls getTreeNodes() to display that particular level in the source-node hierarchy. Users can traverse this hierarchy to select the level of detail. For more information, see Moving through the source-node hierarchy.

  2. From the Select Source dialog box, keeps track of the names of the source nodes in the hierarchy that you select for content generation. The wizard generates an array that contains the names of the selected source nodes.

Step 4 of Business Object Wizard displays the Confirm Source Nodes dialog box, which displays the selected source nodes. Users can either confirm the selections or go back to the Select Source dialog box to reselect source nodes. When the Next button is clicked, the wizard begins the content generation.

For information on how to implement the getTreeNodes() method, see Generating source nodes.

Generating content

You can write an ODA to generate one or both of the content types listed in Table 19. The content type determines the structure of the data that the ODA generates. For an ODA to support a particular content, it must implement the appropriate content-generation interface for the ODA. Table 19 lists the content types that an ODA can support as well as the associated content-generation interface the ODA must implement.

Table 19. Content types for an ODA

Content type Description Content-generation interface
Business object definitions The ODA generates business object definitions to represent the objects in the data source. IGeneratesBoDefs
Binary files The ODA generates file objects to hold information about the generated content. IGeneratesBinFiles

Note:
With this release, an ODA must support the generation of business object definitions as its content. Therefore, it must implement the IGeneratesBoDefs interface. Additionally, the ODA can support the generation of files as its content by implementing the IGeneratesBinFiles interface.

After source nodes are selected and confirmed, Business Object Wizard enters Step 5 of the content generation. It displays the Generating Business Objects screen and passes the array of user-selected source nodes (from Step 4) to the ODA by calling the content-generation method for business object definitions, generateBoDefs(). This method generates the corresponding business object definitions for the selected source nodes. Because an ODA must support the generation of business object definitions in the on-request content protocol, Business Object Wizard always calls the generateBoDefs() method. Therefore, the ODA developer must implement this method as part of the ODA's implementation of the IGeneratesBoDefs interface.

Whether the ODA generates file content depends on whether it implements the IGeneratesBinFiles interface. If the ODA class implements this interface, the method that actually provides the generated content depends on the content protocol that the ODA uses for the file content type, as follows:

Therefore, whether Business Object Wizard calls the content-generation method for files, generateBinFiles(), depends on the following:

Note:
For more information on content protocols, see Choosing the ODA content protocol.

Regardless of the content protocol uses, the generation of content involves the following steps:

  1. Optionally, obtaining any additional information, such as verb values, as business-object properties.
  2. Generating the requested content and saving it in the generated-content structure in ODA memory.

The following sections summarize these steps. For a more detailed overview of the content-generation process, Table 20 shows where to find more information for each of the supported content types.

Table 20. Content-generation process

Content type For more information
Business object definitions Generating business object definitions
Binary files Generating files

Obtaining business-object properties

Often the ODA needs additional information before it can generate the business object definitions. The ODA can request this additional information by defining business-object properties. The ODK API represents a business-object property as an agent-property (AgentProperty) object. To collect business-object properties, the ODA can have Business Object Wizard display the BO Properties dialog box. In this dialog box, the wizard displays the business-object properties, allows updates, and writes the user-initialized properties into the ODA runtime memory, as Figure 53 shows.

To display the BO Properties dialog box, the content-generation method of the ODA calls the getBOSpecificProps() method (defined in the ODKUtility class).

Figure 56. Obtaining business-object properties


As Figure 56 shows, the getBOSpecificProps() method takes the following steps:

  1. Sends the business-object properties to Business Object Wizard, which displays them in the BO Properties dialog box.

    To send the business-object properties, the getBOSpecificProps() method sends as an argument the initialized array of agent-property (AgentProperty) objects, one object for each business-object property to display.

  2. From the BO Properties dialog box, values can be added or changed. After the Next button is clicked, the wizard sends the user-initialized business-object properties back to the getBOSpecificProps() method in the ODA.

    You can access these business-object properties within the ODA through the Java Hashtable object that getBOSpecificProps() returns. Alternatively, you can access these properties through an instance of the ODKUtility class, which provides the getBOSpecificProperty() and getAllBOSpecificProperties() methods.

The ODA can call getBOSpecificProps() repeatedly to obtain different sets of business-object properties. For more information on how to use the getBOSpecificProps() method, see Requesting business-object properties.

Providing generated content

The ODA provides its generated content to Business Object Wizard in two parts:

The method that provides the generated content depends on the content protocol that the ODA uses for a particular content type, as follows:

Note:
For more information on content protocols, see Choosing the ODA content protocol.

The following table shows where to find more information on how to provide generated content:

Content type For more information
Business object definitions Providing generated business object definitions
Binary files Providing generated files

To retrieve the generated content, Business Object Wizard calls the appropriate content-retrieval method as Table 21 shows.


Table 21. Content-retrieval methods

Content type Content-retrieval method For more information
Business object definitions IGeneratesBoDefs.getBoDefs()
Providing access to generated business object definitions
Binary files IGeneratesBinFiles.getBinFile()
Providing access to generated files

The content-retrieval method accesses the generated-content structure within the ODA object and returns specified content in an array to Business Object Wizard. Business Object Wizard must have access to the generated content before it can process the request to save the content in Step 6. For more information, see Saving content.

Saving content

Step 6 of Business Object Wizard displays the Save Business Objects dialog box, which provides options for saving the generated business object definitions. As Figure 44 shows, Business Object Wizard provides the ability to save generated content to an ICL project or a file, or to open each business object definition in Business Object Designer. To save the generated business object definitions in the specified format, Business Object Wizard must access the generated content. It has retrieved this content in the previous step (Step 5), using the ODA's content-retrieval method listed in Table 21.

Copyright IBM Corp. 1997, 2004