IBM provides a sample Object Discovery Agent that converts Roman-army soldiers (in XML format) to business object definitions. To familiarize you with using an ODA, the following step-by-step description of generating business object definitions uses this sample ODA.
This section includes the following tasks:
If you have installed the Adapter Development Kit (ADK), the sample ODA and the file to run it are located in the DevelopmentKits\Odk\Samples directory in the product directory. The file to run the sample ODA depends on your operating-system environment, as Table 12 shows.
Table 12. Startup script for a sample Roman Army ODA
Operating system | Startup script |
---|---|
Windows | start_Agent4.bat |
Because the sample Roman Army ODA provides five versions of itself, all startup scripts call one common startup script called start_AgentX, passing it the name of the ODA class (which is assigned to the AGENTCLASS configuration variable in start_AgentX). Therefore, the start_Agent4 startup script should contain a call to start_AgentX, passing it the following path as the name of the ODA class:
com.ibm.btools.ODK2.RomanArmy.ArmyAgent4
To verify configuration variables for this sample ODA, check the start_AgentX batch or script file to confirm that your confirmation variables match those in Table 13. If you move any of the files that version 4 of the sample Roman Army ODA uses, make sure you change the corresponding configuration variable.
Table 13. Configuration variables for the sample Roman Army ODA
Variable | Value for sample Roman Army ODA |
---|---|
AGENTNAME | set AGENTNAME=Roman |
AGENT |
UNIX: set AGENT = ${ProductDir}/DevelopmentKits/Odk/Samples/RomanArmy/ArmyODA.jar WINDOWS: set AGENT = %ProductDir%\DevelopmentKits\Odk\Samples\RomanArmy\ArmyODA.jar |
FILE_LOCATION |
UNIX: set FILE_LOCATION = ${ProductDir}/DevelopmentKits/Samples/Odk/RomanArmy/RomanArmy.xml WINDOWS: set FILE_LOCATION = %ProductDir%\DevelopmentKits\Samples\Odk\RomanArmy\RomanArmy.xml |
Important |
---|
You must start the sample ODA before you try to connect to it through Business Object Wizard. Business Object Wizard can only locate those ODAs that have been started. |
To start Business Object Wizard, do the following:
Business Object Wizard displays the first dialog box, Select Agent, shown in Figure 34..
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 this sample ODA, the default name of this message file is RomanAgent.txt. For more information, see Specifying the ODA message file. |
Figure
37. Initial Select Source dialog box
The nodes of the source-node hierarchy can be table names, business object names, schema, or functions, depending on the ODA's data source. This sample ODA generates nodes from objects within an XML file called RomanArmy.xml. Figure 37 shows the single top-level source node for the Roman general specified for the Army general configuration property (see Figure 36).
Figure 38. Select
Source dialog box with source nodes expanded and
selected
To expand a source node to display its child nodes, do either of the following:
Figure 39.
Right-clicking a node
Figure 40. Confirming
the objects for which to generate business object
definitions
If your selection is not correct, click Back to return to the previous dialog box and make the necessary changes.
Figure 41. Generating
the definitions
If the ODA needs additional information, Business Object Wizard prompts you for this information by displaying the BO Properties dialog box. However, this sample ODA does not require additional information. For more information about the BO Properties dialog box, see Providing additional information.
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, you can verify that each business object definition has a key attribute, adding one if none exists. Business Object Designer does not allow you to save any business object definition that does not include a key. |
Figure 42.
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 box 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, select this option.
After you click Finish, if you have selected the option to save the business object definitions to a file, a browse window opens and allows you to specify the name of this file, where to save it, and what format to use (text file or ICS-specific format).
You have now successfully created business object definitions using an Object Discovery Agent.