When you first edit a new Transformation Map, the Altova MapForce window is shown and the map workspace is empty.
Note that LANSA Composer has already assigned a file name and path to the map. The file name is based on the identifier you assigned to the Transformation Map in Create or Copy a Transformation Map in Work with Transformation Maps. You can see the file name in the title bar – in this case DEM_ORDER.mfd. When you save your map, do NOT change the name or path. If you do so, LANSA Composer will not find or use your saved map definition.
Before you proceed further, you should note in the toolbar that either Java or Built-in is selected as the target execution language/environment:
Make sure that the correct option is selected – this is important as it can determine which MapForce features are available and valid for use in your map. For more information, refer to Transformation Map Executable Files .
Note: The mapping tool includes menu options and tool buttons for generating code for mapping in various languages. Do not use these options as LANSA Composer will automatically generate the executable code for the map when you complete the Prepare step.
A typical Transformation Map transforms data from one format to another – for example, from an in-coming order in xml format to one or more database tables. The steps to create this type of map will typically include:
1. Insert the source component.
To insert an XML, EDI, text or database component that is to be the source component for the mapping, select the appropriate option from the Insert menu (or use the corresponding toolbar button) and complete the resulting dialogs to make your selection.
2. Insert the target component.
Insert the XML, EDI, text or database component that is to be the target component for your map. To do this, you follow the same procedure as you did to insert the source component. When you have completed your selections, the components are added to the map workspace. You can re-arrange the components in the workspace to make them easier for you to work with.
The source and target are shown in a tree view. The triangles in the edges of each item indicate the input and output connectors for use when mapping the individual elements, attributes, columns or fields.
For further information about inserting database components in your map, refer to Connecting to databases in Transformation Maps.
3. Connect source nodes to the target nodes whose output they should trigger.
Most connections in your map concern data elements, attributes and fields.
However, it is also very important to make the connections that specify when output nodes are to be created.
For example, the two connections illustrated below specify (a) that a database record is created in table TUTORDH for each <SalesOrder> element and (b) that a database record is created in table TUTORDL for each <Line> element.
To create the connections, you click and drag from the output connector (the small triangle) of a source node to the input connector of the corresponding target node. When you release the mouse over the input connector of the target node, the mapping tool draws the connector between the two. You proceed in this way until all necessary connections are made.
4. Connect elements, attributes, columns or fields of the source and target components.
Create connections between corresponding elements, attributes, columns or fields of the source and target components. To create the connections, you click and drag from the output connector (the small triangle) of a source data item to the input connector of the corresponding target data item. When you release the mouse over the input connector of the target data item, the mapping tool draws the connector between the two. You proceed in this way until all necessary connections are made.
5. Add input components as required.
If you are preparing maps for execution as Java executable files (.JAR), then when you prepare your map, LANSA Composer will automatically add a parameter to let you dynamically specify the file path and name of any non-database input and output file components – for example, for the TUTORDER (order XML) component in the illustration.
If, however, you are preparing maps for execution as MapForce Server execution files (.JAR), then those map parameters are not automatically generated – you must specify them yourself.
To do so, firstly add an Input component using the Insert input command from the Insert menu.
Then make the file component dynamic by clicking the button near the top-right of the file-based component and selecting Use Dynamic File Names Supplied by Mapping.
Finally connect the Input component to the File: <dynamic> node of the file-based component.
6. When complete, save your map and close MapForce.
When you save your Transformation Map definition in MapForce, it is saved as a .mfd mapping file that contains the map definition. The .mfd file is not executable. In order to execute the map, you must prepare the map. Refer to Prepare Transformation Map for information.