A variable is a placeholder for a value in the Java code. This section provides the following information about using variables in transformation code:
This section provides information about generating business object variables for the source and destination business objects.
When you add a business object to the map, Map Designer Express automatically generates the following:
The instance name that Map Designer Express generates is a system-declared local variable that you can use to refer to this business object in the mapping code. It is prepended with the letters Obj, which is followed by the name of the business object definition.
Example: If you add Customer to the map, its instance name is ObjCustomer. Map Designer Express generates an instance name for both the source and destination business objects.
The business object index represents the order of this source or destination business object. The index number of the first source and destination business objects in a map is zero. Additional business objects take the next available index number, such as 1, 2, 3, and so on.
When the map is executed, the index number represents the position of the business object in the array that is passed into the map (source business objects) or returned by the map (destination business objects).
Map Designer Express displays this information in the following locations:
Right-click the title bar of the business object window and select Properties from the Context menu. The Map Properties dialog appear with the Business Objects tab displaying and the selected business object highlighted in the list. This tab displays both the instance name and its index within the business object array (if the business object is multiple cardinality).
The title bar displays the instance name for the business object.
You can modify these
business object variables from the Business Objects tab of the
Map Properties dialog (see
Figure 73).
Figure 73. Business Objects Tab of the Map Properties Dialog
To change the business object type of the source or destination business object in the map in the Map Properties dialog, perform the following steps:
Result: The General tab of the Map Properties dialog box appears. Click the Business Objects tab.
For information on other ways to display the Map Properties dialog, see "Providing map property information"..
Map Designer Express lets you create temporary variables that can be accessed in transformation steps throughout the map; that is; temporary variables are global to the map. For example, you can calculate a value in one transformation step, store it in a temporary variable, and reference the variable in another transformation step. This is especially useful if a certain calculation is performed repeatedly; you can perform the calculation once, store the result in a temporary variable, and retrieve the value as needed (for example, with a Move transformation).
Temporary variables are defined within a temporary business object. You create a temporary business object from the Temporary tab of the Add Business Object dialog. To display the Add Business Object dialog, perform the following steps:
For information on other ways to display the Add Business Object dialog, see "From the Add Business Object dialog"..
Result: The General tab of the Add Business Object Properties dialog box appears.
Through the Temporary tab of the Add Business Object dialog, you specify the temporary variables. To define a temporary variable:
Result: A new row appears in the variables table. Enter the name of the temporary variable.
Once Map Designer Express creates the temporary business object, this business object appears in the Table and Diagram tabs with the map's other business objects, as follows:
This Temporary business object window has many of the same characteristics as a business object window. Variables you create appear in the variables table just like attributes in a business object. This business object window provides a Rule and Comment column where you can add the temporary variable's transformation code and comment, respectively.
You can right-click in the title bar of the Temporary business object window to get a Context menu that provides options to edit and delete this business object, as well as its properties.
To specify a value for the variable, copy the value from a business object attribute to the variable by holding down the Ctrl key and dragging the attribute onto the variable name. You can also split and join attributes into a variable.
You use the temporary variable in a transformation step in this way: