Altova MapForce Server 2025 

The MapForceServer class creates a new MapForce Server object instance, and provides access to the MapForce Server engine.

 

Methods

Name

Description

addCredentialPropertiesFromMap

Adds properties from a credential property map to the current credential. This method takes as argument a credential property map (property_name, property_value). This method must be called after calling beginCredential() and before calling endCredential(). As an alternative to calling this method, you can also call AddCredentialProperty().

addCredentialProperty

Adds a property to the current credential (for example, the username, the password, or both). The first argument specifies the property name, and the second argument specifies the property value. Valid property names: username, password. In MapForce Server Advanced Edition, the property name oauth:token is additionally supported.

 

This method must be called after calling beginCredential() and before calling endCredential(). As an alternative to calling this method, you can also call addCredentialPropertiesFromMap().

addParameter

Assigns a value to a parameter defined in the mapping.

beginCredential

Creates a new credential with the name supplied as argument. If you call this method, you must also add properties to it using addCredentialProperty() or addCredentialPropertiesFromMap(), and finally close the credential by calling endCredential().

clearCredentialList

Clears the list of credentials set previously. All credentials are valid for the lifetime of the object. Call this method if you need to explicitly clear all of the previously set credentials.

clearOptions

Clears the list of options previously set through the setOption() method. All options set through the setOption method are valid for the lifetime of the object. Call this method if you need to explicitly clear all of the previously set options.

clearParameterList

Clears the list of parameters that were previously set using the addParameter method.

endCredential

Closes a credential object that was previously created using the beginCredential method.

getAPIMajorVersion

Gets the major version of the MapForce Server API. This can be different from the product version if the API is connected to another server.

getAPIMinorVersion

Gets the minor version of the MapForce Server API. This can be different from the product version if the API is connected to another server.

getAPIServicePackVersion

Gets the service pack version of the MapForce Server API. This can be different from the product version if the API is connected to another server.

getLastExecutionMessage

Gets the message received during the last run command.

getMajorVersion

Gets the major version of the product, as number of years starting from 1998 (for example, "20" for Altova MapForce Server 2018).

getMinorVersion

Gets the minor version of the product (for example, "2" for Altova MapForce Server 2018 r2).

getOutputParameter

Gets the string output generated by the last run command. Returns null if no output was generated. This function requires a string parameter which identifies the name of the output component in MapForce.

getProductName

Gets the name of the product (for example, "Altova MapForce Server").

getProductNameAndVersion

Gets the complete name and version of the product (for example, "Altova MapForce Server 2018 r2 sp1 (x64)").

getServerPath

Gets the path to the server's binary executable file.

getServicePackVersion

Gets the service pack version of the product (for example, "1" for Altova MapForce Server 2018 r2 sp1 (x64)).

getWorkingDirectory

Gets the current working directory.

is64bit

Returns true if the MapForce Server engine is a 64-bit executable.

run

Executes a MapForce Server Execution file (.mfx file). Returns true in case of success; false otherwise.

setOption

Sets an option before running the mapping. The first argument specifies the name of the option, while the second argument specifies the option value. This method is particularly useful when a mapping was designed to consume Global Resources (see Altova Global Resources). The currently supported options are as follows:

 

globalresourcefile (or gr) - A Global Resource file path. (When this option is specified, then a Global Resource configuration name must also be specified, see next item).

globalresourceconfig (or gc) - A Global Resource configuration name. (When this option is specified, then a Global Resource file path must also be specified, see previous item).

catalog - The path to a custom RootCatalog.xml file. This option enables you to specify a custom catalog file used to resolve URLs used by the mapping. The default catalog is in the etc subdirectory of the program installation directory.

taxonomy-package - The path to a custom XBRL taxonomy package, if one is required by the mapping.

taxonomy-packages-config-file - The path to a custom XBRL taxonomy package configuration, if one is required by the mapping.

 

All set options are valid for the lifetime of the object. If you set an option with the same name twice, the previous option will be overridden. To explicitly clear all options, call the clearOptions() method.

setServerPath

Sets the path of the MapForce Server executable.

setWorkingDirectory

Sets the current directory for running jobs (relative paths will be evaluated against the working directory).

stop

Stops the server process.

 

Examples

For an example of creating a new instance of MapForceServer in Java, see the Java example.

© 2018-2024 Altova GmbH