Altova MapForce 2024 Professional Edition

If you need to create a mapping that takes parameters as input, you can do so by adding a special component type called "simple input component". Simple input components always have a simple data type (for example, string, integer, and so on) instead of a structure of items and sequences. For example, in the mapping illustrated below, there is a simple input component count. Its role is to supply as parameter the maximum number of rows that should be retrieved from the source XML file (with value 10 as default). Importantly, the nodes supplied as input to the first-items function are sorted with the help of a sort component, so the mapping outputs the highest N temperatures only, where N is the parameter's value.

mf_simple_input_05

FindHighestTemperatures.mfd

Another fairly common usage of simple input components is to supply a file name to the mapping. This is useful in mappings that read input files or write output files dynamically, see Processing Multiple Input or Output Files Dynamically.

 

You can use simple input components in any the following MapForce transformation languages:

 

BUILT-IN (when you preview the mapping transformation directly in MapForce, from the Preview tab)

BUILT-IN (when you run a compiled MapForce Server execution file)

XSLT 1.0, XSLT 2.0, XSLT 3.0

XQuery

C++

C#

Java

 

In case of mappings executed with MapForce Server or by means of generated code, simple input components become command line parameters. In case of mappings generated as XSLT transformations, simple input components correspond to stylesheet parameters in the generated XSLT file.

 

You can create each simple input component (or parameter) as optional or mandatory, see Adding Simple Input Components. If necessary, you can also create default values for the mapping input parameters, see Creating a Default Input Value. This enables you to safely run the mapping even if you do not explicitly supply a parameter value at mapping execution time. For an example, see Example: Using File Names as Mapping Parameters.

 

Input parameters added on the main mapping area should not be confused with input parameters in user-defined functions. There are some similarities and differences between the two, as follows.

 

Input parameters on the mapping

Input parameters of user-defined functions

Added from Function | Insert Input menu.

Added from Function | Insert Input menu.

Can have simple data types (string, integer, and so on).

Can have simple as well as complex data types.

Applicable to the entire mapping.

Applicable only in the context of the function in which they were defined.

 

When you create a reversed mapping (using the menu command Tools | Create Reversed Mapping), a simple input component becomes a simple output component.

 

© 2017-2023 Altova GmbH