Compiling Mappings to MapForce Server Execution Files
When the target language of a mapping created in MapForce is set to BUILT-IN, it can be executed not only by MapForce, but also by MapForce Server (see About MapForce Server). There are two ways to execute a mapping with MapForce Server:
•If MapForce Server runs in standalone mode (that is, no FlowForce Server is installed), the mapping must be compiled to a server execution file (.mfx), as shown below. You can then run the .mfx file at the command line, using the command run. You can also run the mapping by invoking the run method of the MapForce Server API. For further information, see the MapForce Server documentation (https://www.altova.com/documentation).
•If MapForce Server runs under FlowForce Server management, you can deploy the mapping to a machine where both MapForce Server and FlowForce Server run. For more information about this scenario, see Deploying Mappings to FlowForce Server.
To compile a mapping to a MapForce Server Execution (.mfx) file:
1.Open a mapping in MapForce (for example, myMapping.mfd).
2.On the File menu, click Compile to MapForce Server Execution File.
3.Select the folder you want to place the .mfx file in and change the file name if necessary.
4.Click Save. The MapForce Server Execution file myMapping.mfx is generated in the selected folder.
To compile a mapping to a MapForce Server Execution (.mfx) file, using the command line:
•Run MapForce at the command line, and specify the mapping file and the /COMPILE command line option.
For example, the following command compiles the mapping C:\Users\altova\Documents\Altova\MapForce2023\MapForceExamples\SimpleTotal.mfd to a MapForce Server execution file that will be created in the target output directory C:\Users\altova\Desktop.
"C:\Program Files (x86)\Altova\MapForce2023\MapForce.exe" "C:\Users\altova\Documents\Altova\MapForce2023\MapForceExamples\SimpleTotal.mfd" /COMPILE "C:\Users\altova\Desktop"
See also the MapForce Command Line Interface.
What's included in the .mfx file
The .mfx file includes the following data:
•The mapping algorithm, which includes all user-defined functions (UDFs) imported from other mappings.
•Input and output file names referenced from components. Paths are absolute or relative depending on the mapping settings, see Paths in Various Execution Environments.
•If the mapping contains XML components, information about the XML schema needed to execute the mapping is encoded into the mapping algorithm.
•The database connection details, if the mapping includes database connections. Passwords are encrypted.
The input instance files (XML, CSV, Text) that are used by the mapping are not included in the compiled .mfx file. The same is true for file-based databases such as Access or SQLite. For details, see Preparing Mappings for Server Execution.
If your MapForce Server has an older version than MapForce, the former might not be able to execute .mfx files created with a newer version of MapForce, since new features will likely have been added in the meanwhile. In such cases, you can compile the .mfx file for a specific version of MapForce Server, as follows:
1.On the Tools menu, click Options, and then click Generation.
2.Under Server Execution File, next to Generate for MapForce Server version, select the required MapForce Server version from the drop-down list.
Once you have a newer MapForce Server version, remember to change this option accordingly. If you have no particular reason to compile for a specific version of MapForce Server, select the "most current" option (this is the default option). When this option is selected, the .mfx file is compiled for the most recent version of MapForce Server and could benefit from latest features and improvements which might otherwise not be available in previous versions.
To specify a target MapForce Server version at the command line, run the /COMPILE command with the /MFXVERSION switch, for example:
"C:\Program Files (x86)\Altova\MapForce2023\MapForce.exe" /COMPILE /MFXVERSION:2023
See also the MapForce Command Line Interface.
Compilation of MapForce Server Execution Files is also affected by the following options:
Convert all ADO and ODBC Database Connections to JDBC
If the option is enabled, ADO, ADO.NET, and ODBC database connections are transformed to JDBC using the JDBC driver and the database URL defined in the Database Component Settings dialog box (see Database Component Settings).
The JDBC connection will be used implicitly if the target machine is a Linux or macOS server.
Ignore Digital Signatures (unsupported by MapForce Server)
This option is applicable only to MapForce Enterprise. It is enabled by default. If the mapping uses XML digital signatures, it skips the digital signature information, since MapForce Server does not support XML digital signatures.
To view or change these options:
•On the Tools menu, click Options, and then click Generation.
These options are also available from the command line interface. See also the MapForce Command Line Interface.