This section describes how to use an Object Discovery Agent (ODA) to generate business object definitions for application-specific business objects. An ODA is an optional component of an adapter. When you install a pre-defined adapter that has an ODA, its ODA is installed automatically.
At runtime, execution of an ODA involves the following components:
Figure 34 shows the components of the ODA runtime architecture.
Figure 34. Object Discovery Agent Architecture
To configure and run the ODA, use Business Object Wizard within Business Object Designer Express. Business Object Wizard is a graphical user interface to ODAs, as well as managing the discovery and content-generation process. This section provides the following information:
Before you run an ODA, verify that the following steps have occurred:
For the ODA to launch, you need to verify that your system has the required files for the ODA. When you install a pre-defined adapter that has an ODA, these ODA system startup files should be installed automatically. However, IBM recommends that you confirm that the following files exist and are correct for your ODA:
ODA startup script: Each ODA requires a
startup script, which begins execution of the ODA. Before
you launch an ODA for the first time, you must make sure that the variables
are correctly set within the startup script. Open for editing the batch
file (start_ODAname.bat) and confirm that the
values described in Table 9 are correct.
Table 9. ODA batch file configuration variables
Variable | Explanation | Example |
---|---|---|
set AGENTNAME | Name of the ODA | set AGENTNAME=ODAname |
set AGENT | Name of the ODA's jar file |
set AGENT =
%ProductDir%\ODA\srcDataName\ODAname.jar
|
set AGENTCLASS | Name of the ODA's Java class | set AGENTCLASS=com.ibm.oda.srcDataName.ODAname |
ODA environment file: For an ODA's startup script to run, it needs to locate the ODA environment file. This file, CWODAEnv.bat, establishes general settings for various software and information that an ODA needs at runtime. It should be installed in the bin subdirectory of your product directory: ProductDir\bin
You can launch an ODA with the following startup script:
start_srcDataNameODA.bat
You configure and run the ODA using Business Object Wizard within Business Object Designer Express. Business Object Wizard locates each ODA by the name specified in the AGENTNAME variable of each script or batch file.
Once you launch the ODA, you must launch Business Object Designer Express to configure and run it. For information on the ways to launch Business Object Designer Express, see Launching Business Object Designer Express. To run an ODA, Business Object Designer Express provides Business Object Wizard, which guides you through each step.
To start Business Object Wizard, do the following:
Business Object Designer Express invokes the Business Object Wizard to run the ODA. Step 1 of Business Object Wizard displays the first dialog in the wizard, Select Agent, which provides graphical access to all available Object Discovery Agents. From this dialog, the user selects the desired ODA to run. To display the names of all ODAs that are running on the current machine, click the Find Agents button.
Table 10 summarizes the steps of Business Object Wizard.
Table 10. Steps of Business Object Wizard
Execution task | Step in Business Object Wizard | |
---|---|---|
1. | Select the desired ODA. | Step 1: Select Agent |
2. | Obtain the configuration properties, including those that describe the data source to open. | Step 2: Configure Agent |
3. | Obtain the source data for which the ODA generates the content. | Step 3: Select Source |
4. | Confirm that the selected source nodes are those desired for content generation. | Step 4: Confirm Source Nodes |
5. | Initiate the content-generation process. | Step 5: Generating Business Objects |
|
| Business Object Properties |
6. | Save the business object definitions in a user-specified format. | Step 6: Save Business Objects |
The steps outlined in this section include sample screens of an Object Discovery Agent that converts Roman-army soldiers (in XML format) to business object definitions.
Business Object Designer Express invokes Business Object Wizard, which displays the first dialog in the wizard, Select Agent, shown in Figure 35.
Business Object Wizard identifies each running ODA by the name specified for the AGENTNAME variable of its startup script or batch file. This sample ODA is named Roman.
The first time you use a particular ODA, you specify values for each of its configuration properties. After doing so, you can save the property values in a named profile by clicking the Save button. The next time you use the same ODA, you can select the saved profile from the "Select profile" box. For more information, see "Entering values and saving a profile".
Important |
---|
If the ODA is unable to proceed when you click Next, verify that the ODA message file you have specified for the MessageFile configuration property exists in the ProgramDir\ODA\messages directory. For more information, see Specifying the ODA message file. |
Figure 38. Initial Select Source dialog.
The nodes of the source-node hierarchy can be table names, business object names, schema, or functions, depending on the ODA's data source. The ODA illustrated in these steps generates nodes from objects within an XML file called RomanArmy.xml. Figure 38 shows the single top-level source node for the Roman general specified for the Army general configuration property (see Figure 37).
Figure 39. Select Source dialog with source nodes expanded and selected.
To expand a source node to display its children, do either of the following:
Figure 40. Context Menu for a node.
To expand the selected node, click the "Retrieve all items" menu item. Business Object Wizard displays the next level of source nodes: the child nodes for the expanded parent node. To open lower levels, repeat this process.
Figure 41. Confirming the objects for which to generate business object definitions.
If your selection is not correct, click Back to return to the previous dialog and make the necessary changes.
Figure 42. Generating the definitions.
If the ODA needs additional information, Business Object Wizard prompts you for this information by displaying the BO Properties dialog. However, this sample ODA does not require additional information. Therefore, this dialog does not display. For more information about the BO Properties dialog, see Providing additional information.
business object definitions that the ODA has generated:
Important |
---|
If the ODA generates a business object definition from a data-source object that does not identify a key element, this business object definition will not have a key attribute. Every business object must have at least one key. If the ODA might have generated business object definitions that do not include keys, you might want to choose the "Open the new BOs in separate windows" option instead of saving the business object definitions. Within Business Object Designer Express, you can verify that each business object definition has a key attribute, adding one if none exists. Business Object Designer Express does not allow you to save any business object definition that does not include a key. |
Figure 43. Saving the business object definition.
Click Finish to save the business object definitions or Cancel to exit without saving these definitions. In either case, Business Object Wizard disconnects from the ODA. This dialog also provides the option to have Business Object Wizard shut down the ODA after it disconnects. If you no longer need to use the ODA, click this option.
After you click Finish, if you have told Business Object Wizard to save the business object definitions to a file, Business Object Wizard provides a browse window that allows you to specify the name of this file, where to save it, and what format to use (text file or InterChange Server Express-specific format).
You have now successfully created business object definitions using an Object Discovery Agent.
You can save a particular set of ODA configuration values in a profile so that they can be available for future uses of the ODA. To save a profile:
Business Object Wizard saves the profile under the following directory:
C:\Documents and Settings\All Users\Application Data\CrossWorlds\ BusObjDesigner\profiles.bod
As part of the configuration of the ODA, you must set up the logging and
tracing. You specify the logging and tracing information for an ODA in
the Configure Agent dialog of Business Object Wizard. Business Object
Wizard always provides the standard
configuration properties (shown in Table 11) for an ODA.
Table 11. Standard ODA configuration properties.
Property name | Property type | Description |
---|---|---|
TraceFileName | String | Specifies the file into which the ODA writes trace information. For more information, see "Specifying the trace file and trace level". |
TraceLevel | Integer |
Trace level enabled for the ODA. For more information, see "Specifying the trace file and trace level".
|
MessageFile | String | Name of the ODA's error and message file. Use this property to verify or specify an existing file. For more information, see "Specifying the ODA message file". |
This section provides the following information:
Figure 44 shows the Configure Agent dialog in Business Object Wizard, in which you specify the name of the trace file and the trace level.
Figure 44. Specifying tracing information.
The TraceFileName configuration property specifies the name of the ODA's
trace file. This file is the destination for all trace and error messages that the ODA logs. By default, the ODA runtime names the trace file according to the following naming convention:
ODAnametrace.txt
In the preceding line, ODAname is the name that uniquely identifies the ODA. For example, if the ODA is named HTMLODA, it generates a trace file named HTMLODAtrace.txt.
If the specified trace file does not exist, the ODA creates it in the ODA's runtime directory, which is the ODA\srcDataName subdirectory of the product directory. If the specified trace file already exists, the ODA appends to it. When configuring the ODA, you can specify a different name for the trace file by resetting the TraceFileName property.
The
TraceLevel configuration property specifies the ODA's system
trace level. The ODA's trace method sends the specified
message to the trace file when the message's trace level is less than or
equal to this system
trace level. Therefore, the system trace level determines the level of
detail that the trace messages provide. Table 12 lists trace levels and their associated behavior.
The MessageFile configuration property specifies the name of the ODA's message file. An ODA can store its error and trace messages in this ODA message file. It can then retrieve these messages by message number, instead of creating the message text itself.
By default, the ODA runtime names this message file according to the following naming convention:
ODAnameAgent.txt
In the preceding line, ODAname is the name that uniquely identifies the ODA. For example, if the ODA is named HTMLODA, the value of the MessageFile property defaults to HTMLODAAgent.txt. The message file must reside in the following message-file directory:
ProductDir\ODA\messages
Important |
---|
If the specified message file does not exist or does not exist in the message-file directory, the ODA generates a runtime exception. You must ensure that the message file (which MessageFile specifies) exists before you continue with the execution of the ODA. |
If the ODA uses a different message file, set the MessageFile property to specify a different name for the trace file.
If you create multiple instances of the ODA script or batch file and provide a unique name for each represented ODA, you can have a message file for each ODA instance. For more information, see Using multiple ODAs simultaneously.
Within the Select Source dialog, Business Object Wizard provides the following mechanisms for moving through the nodes of the source-node hierarchy:
The ways to expand a source node given in step 8 describe how to display all children of an expandable node. To limit which objects are displayed, you can use either of the following options from the context menu for a node name (see Figure 40):
The Apply Filter menu item allows you to specify a filter, which can limit which of the currently selected source nodes displays. When you click this menu item, Business Object Wizard displays the " Apply filter to node" dialog, as shown in Figure 45.
Figure 45. Specifying a filter to limit results.
In the filter text, you can use the asterisk (*) character as a wildcard (to represent zero or more matching characters). This wildcard character can appear in any position and in as many positions as required. For example, SAP*, *SAP, *SAP*, or *S*AP*.
When you click OK, Business Object Wizard searches the currently retrieved children of the parent node for those whose names match the filter text. When it expands this parent node, it displays only those children whose names match this text.
If you specify a filter at the top of a node and then expand the node, you can apply the same filter to child objects by clicking the "Apply parent's filter" menu item from the node's context menu. If you used the "Retrieve all items" menu item, the parent's filter is applied to all elements.
The "Search for items" menu item allows you to specify a search pattern, which can limit which source nodes Business Object Wizard selects from the data source. When you click the "Search for items" menu item, Business Object Wizard displays the " Enter a Search Pattern" dialog. Figure 46 illustrates this dialog.
Figure 46. Specifying a search pattern to limit retrieval results.
The Enter a Search Pattern dialog provides a description of the search criteria that your search pattern can use. In Figure 46, the text in this dialog specifies that the search pattern can consist of one letter. The ODA provides a customized description of the search criteria. Make sure that the search pattern you enter follows the described search criteria. Otherwise, the ODA throws an exception.
When you click OK, Business Object Wizard searches the data source for children of the parent node whose names match the search pattern. When it expands this parent node, it displays only those children whose names match this pattern.
Instead of moving through the source-node hierarchy, you can specify an exact path for the desired object. To do so, click "Use this object instead", at the upper right of the Select Source dialog. Business Object Wizard displays the Object Path dialog, shown in Figure 47, in which you specify the path.
Figure 47. Specifying an object's path.
You specify the object path as the fully qualified path of the source node (from the top-level parent down to the desired node). Node names within this path are separated with a colon (:).
To associate an operating-system file with the current node of the source-node hierarchy, click the "Associate files" menu item from the context menu for a node name (see Figure 48). When you associate a file with a source node, the ODA uses the file as the source for that source node's data (instead of using the ODA's data source).
Figure 48. Associating a file with a source node.
When you click the "Associate files" menu item, Business Object Wizard displays the Open window shown in Figure 49. From this window, you can browse the file structure and choose the file to associate with the current node.
Figure 49. Open window for selecting the file to associate.
Once you have selected the file to associate with the source node, click Open. When Business Object Wizard returns control to the Select Source dialog, the file you selected now displays under the source node with which it is associated, as Figure 50 shows.
Figure 50. File associated with a source node.
In Step 5, Generating Business Objects, if the ODA needs additional information, Business Object Wizard prompts you for this information by displaying the BO Properties dialog, as shown in Figure 51.
Figure 51. Providing additional information.
After you provide all required information in the BO Properties dialog, click OK. The ODA continues with its generation of business object definitions.
You can run multiple instances of an ODA either on the local host machine or a remote host machine. Each instance runs on a unique port. You can specify this port number when you launch each ODA from within Business Object Wizard.
To run multiple Object Discovery Agents simultaneously in Business Object Designer Express, do the following:
Business Object Designer Express invokes Business Object Wizard, which displays the first dialog in the wizard, Select Agent (see Figure 35).
Business Object Wizard displays a second instance of the Select Agent dialog.
If you create multiple instances of the ODA script or batch file and provide a unique name for each represented ODA, you can have a message file for each ODA instance. Alternatively, you can have differently named ODAs use the same message file. There are two ways to specify a valid message file: