You can specify several standard attribute
transformations interactively in Map Designer Express. Table 12 shows the standard transformations that you can specify in
Map Designer Express.
Table 12. Common attribute transformations
Name | Transformation step | Purpose |
---|---|---|
Set Value
| Specifying a value for an attribute | For an attribute in the destination business object that is not found in the source business object but is required in the destination application |
Move
| Copying a source attribute to a destination attribute | For an attribute that is the same in both the source and destination business objects |
Join
| Joining attributes | For an attribute in the destination business object that is a combination of several attributes in the source business object |
Split
| Splitting attributes |
For an attribute in the destination business object that is either:
|
Submap
| Transforming with a submap | For attributes in the source and destination business objects that contain child business objects |
Cross-Reference
| Cross-referencing identity relationships | For maintaining the identity relationships for the business objects |
Custom
| Creating a Custom transformation | For an attribute that requires transformations not provided by the automatically generated transformations |
In the Diagram tab, you can select which attributes display in the business object windows with the options of the View-->Diagram menu. You can choose to display all attributes, only linked (mapped) attributes, or only unlinked (unmapped) attributes.
Some destination attribute values do not depend on a source attribute and can be filled in with a constant value. This is especially true if the destination business object contains many attributes that are not found in the source business object but are required in the destination application. Some examples of default values for attributes are CustomerStatus = "active" or AddressType = "business".
This type of transformation is called a Set Value transformation. You set the value of a destination attribute with the Set Value dialog, shown in Figure 15. You can display the Set Value dialog from either of the following Map tabs:
Through the Set Value dialog, you set the constant value to assign to the destination attribute. The Set Value dialog provides the following functionality:
Result: Map Designer Express brings up the Activity Editor in Java view, containing a sample of the transformation code in read-only mode for the destination attribute.
The simplest kind of transformation step is a copy of one source attribute into a corresponding destination attribute. This type of transformation is called a Move transformation. You perform a move transformation from either of the following map tabs:
Map Designer Express creates a blue arrow from the source to the destination object. If the transformation involves a single source attribute that is not a child business object, Map Designer Express assumes that the transformation is a Move and automatically assigns Move to the Rule column of the destination attribute.
Result: Map Designer Express generates the code to copy the value of the source attribute to the destination attribute. If the source and destination attributes are of different data types, Map Designer Express determines whether a type conversion is possible, and if so, generates the code to convert the source type to the destination type. If a type conversion is not possible, or might result in data loss, Map Designer Express displays a dialog box for you to confirm or cancel the operation.
If you want to see a sample of the generated code for the Move transformation, in the Context menu of the rule column, select View Source.
You can concatenate, or join, the values from more than one source attribute into a single destination attribute. This type of transformation is called a Join transformation. For instance, the source business object might store the area code, telephone number, and extension in separate attributes, while the destination business object stores these values together in one attribute.
In addition to joining the attributes, you can reorder them and insert delimiters, parentheses, or other characters. For instance, when joining separate area code and telephone number attributes into a single attribute, you might want to insert parentheses around the area code.
You join multiple source attributes into one destination attribute with the Join dialog, shown in Figure 16. You display the Join dialog in either of the following ways:
Tip: You can click Multiple Attributes in the combo box to display the Multiple Attributes dialog. In this dialog, you can check multiple source attributes. To locate a particular business object, enter its name in the Find field. The up and down arrows scroll through the business object list. Once you have selected the source attributes, click OK to close the dialog.
If the transformation involves more than one source attribute, Map Designer Express assumes that the transformation is a Join. It automatically assigns Join to the Rule column of the destination attribute and displays the Join dialog.
If a Join transformation is already defined, you can use the Join dialog to reconfigure the transformation, including modifying its transformation code, in either of the following ways:
Through the Join dialog, you build an expression to concatenate the source attributes by adding delimiters, grouping with parentheses, and reordering the attributes if necessary. The Join dialog provides the following functionality:
Result: Map Designer Express brings up the Activity Editor in Java view, containing a sample of the transformation code in read-only mode for the destination attribute.
To split a source attribute into two or more destination attributes, you specify the transformation for each destination attribute separately. This type of transformation is called a Split transformation. For instance, to split a source attribute, such as phone_number, into three separate destination attributes, such as area_code, tel_number, and extension, you specify the transformations for area_code, tel_number, and extension separately.
You split a source attribute into multiple destination attributes with the Split dialog, shown in Figure 17. You display the Split dialog in any of the following ways:
If the transformation involves more than one destination attribute, Map Designer Express assumes that the transformation is a Split. It automatically assigns Split to the Rule column of the destination attribute and displays the Split dialog.
If a Split transformation is already defined, you can use the Split dialog to reconfigure the transformation, including modifying its transformation code, in either of the following ways:
Through the Split dialog, you split an expression into segments that are separated by a delimiter. Each segment is identified with an index number, with the first segment having an index number of zero (0). The Split dialog provides the following functionality:
Result: Map Designer Express brings up the Activity Editor in Java view, containing a sample of the transformation code in read-only mode for the destination attribute.
A submap is a map that is called from within another map, called the main map. This section provides the following information about submaps:
You can call a submap to obtain a value for any destination attribute, but submaps are most commonly used for the following:
Using submaps can improve the modularity of your maps by isolating common transformations that can be reused in more than one map. For example, a Customer business object might have an Address child business object that is also a child of an Order business object. If you create a submap for the Address business object, you can reuse the submap in both the Customer and Order business object maps.
Figure 18 illustrates how a submap, MyAddrToGenAddr, can be reused by two different maps.
Figure 18. Using submaps for modularity
When the source and destination attributes contain multiple-cardinality child business objects, it is useful to use a submap to specify their transformations. Typical examples of multiple-cardinality child business objects are the multiple addresses of a customer or the multiple line items in an order.
In the simplest case, you transform each source child business object into a single destination child business object, in a one-to-one relationship. Figure 19 illustrates the use of submaps for an Employee business object and its child business array that contains instances of EmployeeAddress.
Figure 19. One-to-one transformation of child business object arrays
A submap can be associated with a conditional statement that governs
whether it executes. For example, consider Figure 20: the Order business object has an
OrderLine attribute that contains a multiple-cardinality child
business object, OrderLine. The OrderLine
business object has a DeliverySchedule attribute that contains a
multiple-cardinality child business object, DelSched.
Figure 20. Source business object with multiple-cardinality child business object
Some conditions that can be written in the map for Order can:
Perform the following steps to create a Submap transformation.
You do this in the same way that you create and save any other map. IBM naming conventions suggest that submap names begin with the string "Sub_".
You specify that a submap needs to be called with the Submap dialog, shown in Figure 21. You display the Submap dialog in either of the following ways:
If the transformation involves a source attribute that is a child business object, Map Designer Express assumes that the transformation is a Submap. It automatically assigns Submap to the Rule column of the destination attribute and displays the Submap dialog.
If a Submap transformation is already defined, you can use the Submap dialog to reconfigure the transformation, including modifying its transformation code, in either of the following ways:
Through the Submap dialog, you specify the name of the submap to call. The Submap dialog provides the following functionality:
Tip: To locate a particular submap, enter its name in the Find field. The up and down arrows scroll through the business object list.
Result: Map Designer Express brings up the Activity Editor in Java view, containing a sample of the transformation code in read-only mode for the destination attribute.
In some cases, the source attribute may need to reference a relationship table to find out what value to set in the destination attribute. This can be done using a Cross-Reference transformation.
Perform the following steps to use a cross-reference transformation:
Result: The Cross-Reference dialog appears:
Result: The Participant combo box will be populated with all participants from the selected relationship. The Business Object combo box, by default, will be populated according to the mapping role defined in the map property. You can change the combo boxes.
In a Custom transformation, you use the Activity Editor to customize the activity for the transformation graphically. Perform the following steps to define a custom transformation from either the Table or Diagram tab:
Result: Map Designer Express displays the Activity Editor with a graphical view. For more information on the Activity Editor, see "Using the Activity Editor".
If a custom transformation is already defined, you can modify its transformation code in either of the following ways: