Specifying standard attribute transformations

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:

  • Only one part of an attribute in the source business object
  • Made up of several fields, but with different delimiters from those in the source business object

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.

Tip:
Attributes appear in the same order that they appear in the business object definition. To locate a particular attribute in a long list of attributes, select Find from the Edit menu (or use the keyboard shortcut of Ctrl+F). For more information, see "Finding information in a map".

Specifying a value for an attribute

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:

Copying a source attribute to a 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:

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.

Joining attributes

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.

Tip:
The attributes you want to join can sometimes be located in more than one source business object, such as in a parent business object and one of its child business objects. You can also join an attribute with a variable you have defined. (To learn about defining variables, see "Using temporary variables".)

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:

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:

Splitting attributes

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 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:

Transforming with a submap

A submap is a map that is called from within another map, called the main map. This section provides the following information about submaps:

Uses for submaps

You can call a submap to obtain a value for any destination attribute, but submaps are most commonly used for the following:

Improving map modularity

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


Transforming child business objects

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:

Specifying a Submap transformation

Perform the following steps to create a Submap transformation.

  1. Create the map that you want to use as a submap.

    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_".

  2. Save the submap to the project in System Manager and compile the submap.
  3. Specify the Submap transformation on the attribute in the parent business object that needs to call the submap. This source attribute contains a child business object that is mapped to a destination attribute that contains a child business object.

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 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:

Cross-referencing identity relationships

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:

  1. Select the source and destination attributes in any of the ways previously described for other transformation. Both have to be business objects.
  2. Select Cross-Reference in the corresponding transformation cell.

    Result: The Cross-Reference dialog appears:

    Figure 22. Cross-Reference dialog

  3. In this dialog, select the relationship name from the list.

    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.

Creating a Custom transformation

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:

Note:
You can customize the key sequence used to initiate a Custom transformation from the Key Mapping tab of the Preferences dialog. For more information, see "Specifying Key Mappings".

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:

Copyright IBM Corp. 1997, 2003