Altova MapForce 2023 Basic Edition

A mapping may have multiple source and target components. When there are multiple target components, you can preview only one component output at a time in MapForce, the one that you indicate by clicking the mf_ic_preview Preview button. In other execution environments (MapForce Server or generated code), all of the target components will be executed sequentially, and the respective output of each component will be produced.

 

By default, target components are processed from top to bottom and from left to right. If necessary, you can influence this order by changing the position of target components in the mapping window. The point of reference is each component's top left corner. Note the following:

 

If two components have the same vertical position, then the leftmost takes precedence.

If two components 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.

 

For an example of how this works, open the following demo mapping: <Documents>\Altova\MapForce2023\MapForceExamples\Tutorial\GroupingFunctions.mfd. This mapping consists of multiple source and multiple target components; only a fragment is shown below.

mf_semantics_07

According to the rules, the default processing order of this mapping in MapForce Server and in generated code is from top to bottom. You can check that this is the case by generating XSLT 2.0 code, for example.

 

1.On the File menu, click Generate code in | XSLT 2.0.

2.When prompted, select a target directory for the generated code.

 

After generation, the target directory includes several XSLT files and a DoTransform.bat file. The latter can be executed by RaptorXML Server (requires a separate license). The DoTransform.bat file processes components in the same order as they were defined on the mapping, from top to bottom. This can be verified by looking at the --output parameter of each transformation.

 

RaptorXML xslt --xslt-version=2 --input="records.xml" --output="group-by.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups.xslt"
IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%
RaptorXML xslt --xslt-version=2 --input="records.xml" --output="group-adjacent.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups2.xslt"
IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%
RaptorXML xslt --xslt-version=2 --input="records.xml" --output="group-into-blocks.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups3.xslt"
IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%
RaptorXML xslt --xslt-version=2 --input="records-v2.xml" --output="group-starting-with.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups4.xslt"
IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%
RaptorXML xslt --xslt-version=2 --input="records-v3.xml" --output="group_ending_with.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups5.xslt"
IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%

 

The last transformation produces an output file called group-ending-with.xml. Let's now move this target component on the mapping to the very top:

mf_semantics_08

If you now generate the XSLT 2.0 code again, the processing order changes accordingly:

 

RaptorXML xslt --xslt-version=2 --input="records-v3.xml" --output="group_ending_with.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups.xslt"

IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%

RaptorXML xslt --xslt-version=2 --input="records.xml" --output="group-by.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups2.xslt"

IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%

RaptorXML xslt --xslt-version=2 --input="records.xml" --output="group-adjacent.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups3.xslt"

IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%

RaptorXML xslt --xslt-version=2 --input="records.xml" --output="group-into-blocks.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups4.xslt"

IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%

RaptorXML xslt --xslt-version=2 --input="records-v2.xml" --output="group-starting-with.xml" --xml-validation-error-as-warning=true %* "MappingMapTogroups5.xslt"

IF ERRORLEVEL 1 EXIT/B %ERRORLEVEL%

 

In the code listing above, the first call now produces group-ending-with.xml.

 

You can change the processing order in a similar way in other code languages and in compiled MapForceServer execution files (.mfx).

 

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 components 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.

© 2017-2023 Altova GmbH