Skip to main content
Skip table of contents

Using Global Parameters

How can I use global parameters?

Global parameters can be defined via the Global Parameter Configuration. Any parameter groups with global parameters can be created and managed directly in X4 Designer.

These can then be used just like system parameters and project parameters in the X4 Designer (in the editors of adapters, mappings, processes, and conditions).

Using Global Parameters in Adapters

As with system and project parameters, global parameters can also be used in adapter configurations with %PARAM_Group_Name% (see Use Cases for Parameters).

Using Global Parameters in Technical Processes

For using global parameters in Technical Processes, the parameters to be used must first be read into the current process context. The Global Parameter Management adapter can be used to create global parameters via X4 processes and manage them at process runtime. The adapter offers various operations for managing global parameters, such as adding or deleting, but also importing and exporting parameters or parameter groups.

Creating global parameters with the Global Parameter Management Adapter

The following process example shows how global parameters can be created with a mapping via the Global Parameter Management adapter. The technical process reads in an XML document with configuration values, transforms it via a stylesheet and creates the parameters via the adapter with the appropriate operation. Thus, the parameters are available for the project and its processes.

Provide Input XML document

The input XML document must be structured according to the following scheme:

Example: Input XML with predefined parameters
XML
<Placeholder>
    <Group name="MyGroup">
    	<Key name="MyTargetHost" type="String">123.456.789.000</Key>
        <Key name="MyTargetPort" type="Integer">1415</Key>
        <Key name="MyTargetChannel" type="String">Dev</Key>
    </Group>
    <Group name="Thresholds">
    	<Key name="MinMessages" type="Integer">0</Key>
        <Key name="MaxMessages" type="Integer">10</Key>
    </Group>
</Placeholder>

Explanation:

  • The root element Placeholder can contain any number of Group elements.

  • Group represents a parameter group and can contain any number of Key elements.

  • The attribute name within a Group element defines the name of the parameter group.

  • Key represents a parameter and has the following attributes and contents:

    • name: Parameter name

    • type: Parameter type StringBooleanIntegerDecimal or Date  (ISO date format  YYYY-MM-DD )

    • Parameter value corresponding to the parameter type

Modelling the Technical Process

  1. Create a new Technical Process via the menu New > Technical Process.

  2. Drag and drop the input XML file into the Technical Process model and select the operation Read

  3. Drag and drop the Global Parameter Management adapter into the Technical Process model and select the adapter operation AddKeys.

  4. Save the Technical Process and run it.
    The parameters will be created and can be viewed and edited both within the Global parameters and groups and the Administration interface within X4 Control Center.

Using Global Parameters in XSL Mappings

As with system and project parameters, global parameters with %PARAM_Group_Name% can also be used in XSL stylesheets.

Example

The following example shows the use of global parameters in mappings. Before using them, the relevant parameters must be inserted in the XSL mapping. 

Creating the XSL mapping

The XSL mapping must have the following structure. The global parameters to be used have to be declared within the stylesheet with their full qualifies names, first. Then, they can be used as usual.

Beispiel: XSL-Mapping
XML
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
  <xsl:output media-type="text/xml" method="xml"></xsl:output>
  <xsl:param name="PARAM_MyGroup_MyTargetHost"></xsl:param>
  <xsl:param name="PARAM_Thresholds_MinMessages"></xsl:param>
  <xsl:param name="PARAM_Thresholds_MaxMessages"></xsl:param>
  <xsl:template match="/">
    <Result>
      <MyGroup>
        <MyTargetHost><xsl:value-of select="$PARAM_MyGroup_MyTargetHost"></xsl:value-of></MyTargetHost>
      </MyGroup>
      <Thresholds>
        <MinMessages><xsl:value-of select="$PARAM_Thresholds_MinMessages"></xsl:value-of></MinMessages>
        <MaxMessages><xsl:value-of select="$PARAM_Thresholds_MaxMessages"></xsl:value-of></MaxMessages>
      </Thresholds>
    </Result>
  </xsl:template>
</xsl:stylesheet>

Modelling the Technical Process

  1. Create a new Technical Process via the menu New > Technical Process.

  2. Drag and drop the XSL mapping (see example above) into the Technical Process model.

  3. Save the Technical Process and run it.
    The parameters will be loaded and can now be used.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.