Changing the Processing Order of Mapping Components

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Designing Mappings > Mapping Rules and Strategies >

Changing the Processing Order of Mapping Components

MapForce supports mappings that have several target components. Each of the target components has a preview button allowing you to preview the mapping result for that specific component.

 

If the mapping is executed from the command line or from generated code, then, regardless of the currently active preview, the full mapping is executed and the output for each target component is generated.

 

The order in which the target components are processed can be directly influenced by changing the position of target components in the mapping window. The position of a component is defined as its top left corner.

 

Target components are processed according to their Y-X position on screen, from top to bottom and left to right.

 

If two components have the same vertical position, then the leftmost takes precedence.
If two component have the same horizontal position, then the highest takes precedence.
In the unlikely event that components have the exact same position, then an unique internal component ID is automatically used, which guarantees a well-defined order but which cannot be changed.

 

The screenshot below shows the tutorial sample Tut-ExpReport-multi.mfd available in the <Documents>\Altova\MapForce2019\MapForceExamples\Tutorial\ folder. Both target components (ExpReport-Target) have the same vertical position, and the preview button is active on the right hand target component.

Tut-ExpReport-multi-ENT

Tut-ExpReport-multi.mfd (MapForce Enterprise Edition)

Having selected XSLT2 and generated the code:

 

The leftmost target component is processed first and generates the ExpReport.xml file.
The component to the right of it is processed next and generates the SecondXML.xml file.

 

You can check that this is the case by opening the DoTransform.bat file (in the output folder you specified) and see the sequence the output files are generated. ExpReport-Target.xml is the first output to be generated by the batch file, and SecondXML.xml the second.

process2

 

 

Changing the mapping processing sequence:

1.Click the left target component and move it below the one at right.

Tut-ExpReport-multi-detail-ENT

2.Regenerate your code and take a look at the DoTransform.bat file.

process4

SecondXML.xml is now the first output to be generated by the batch file, and ExpReport-Target.xml the second.

 

Chained mappings

The same processing sequence as described above is followed for chained mappings. The chained mapping group is taken as one unit however. Repositioning the intermediate or final target component of a single chained mapping has no effect on the processing sequence.

 

Only if multiple "chains" or multiple target components exist in a mapping does the position of the final target components of each group determine which is processed first.

 

If two final target components have the same vertical position, then the leftmost takes precedence.
If two final target component have the same horizontal position, then the highest takes precedence.
In the unlikely event that components have the exact same position, then an unique internal component ID is automatically used, which guarantees a well-defined order but which cannot be changed.

© 2019 Altova GmbH