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:
Table 18 summarizes the steps in the running of an ODA and the steps in Business Object Wizard that initiate them.
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 |
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:
For more information on how to create the ODA class, see Extending the ODA base class.
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:
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.
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.
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.
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 |
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:
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.
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.
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
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:
Regardless of the content protocol uses, the generation of content involves the following steps:
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 |
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:
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.
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.
The ODA provides its generated content to Business Object Wizard in two parts:
A content-metadata ( ContentMetaData) object contains information about the ODA's generated content. Business Object Wizard uses this information to determine which content-retrieval method to use to retrieve the generated content.
The ODA writes the generated content to a generated-content structure, somewhere that is accessible by the methods of the ODA class. For example, it could write the content to an array that is a member variable of the ODA class.
The method that provides the generated content depends on the content protocol that the ODA uses for a particular content type, as follows:
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.
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.