X4 Help Center

Using Global Parameters

How can I use global parameters?

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

These can then be used in the X4 Designer tools (Adapter Editor, Mapping Editor, Process Editor), just like system parameters and project parameters.


Using system parameters in adapters

Similar to system and project parameters, global parameters with %PARAM_GROUP_NAME% can also be used in adapter configurations.


Using global parameters in Technical Processes

To be able to use global parameters in Technical Processes, the parameters to be used must first be read into the current process context. With the Global Parameter Management adapter, global parameters can be created via X4 processes and managed during the process runtime. The adapter provides various operations for managing project parameters, for example, adding or deleting, but also for importing and exporting parameters or parameter groups.


Creating global parameters using the Global Parameter Management Adapter

The following process example shows how global parameters can be created with a mapping using the Global Parameter Management adapter. The Technical Process reads 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 for the project and its processes are available.


InitializePlaceholders_EN.png

Providing the 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 Placeholder root element can contain any number of Group elements.

  • A Group element represents one cdr at a time and can contain any number of Key elements.

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

  • A Key stands for a parameter and contains the following attributes and contents:

    • name: Name of the parameter

    • type: Parameter type String, Boolean, Integer , Decimal or Date (ISO-Date format YYY-MM-DD )

    • Value of the parameter according to the parameter type

How to model the Technical Process

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

  2. Drag the input XML file (see example) into the Technical Process and select the Read operation in the properties.

  3. Insert a stylesheet to transform the configuration file (input file) to the input structure required by the subsequent adapter.

  4. Drag the Global Parameter Management adapter into the Technical Process and select the AddKeys adapter operation.

  5. Save the Technical Process.

  6. Run the Technical Process.
    The parameters have now been created and can be viewed and edited both in the Global Parameter Configuration and in the X4 Control Center administration interface.


Using global parameters in XSL mappings

Similar to the project and system placeholders, global parameters with %PARAM_GROUP_NAME% can also be used in XSL stylesheets.


Example of usage

Using global parameters in XSL mappings

The following example shows the use of global parameters in mappings. The relevant parameters must be inserted into the XSL mapping before they can be used.

GlobalParameters_Mapping_7.3.png

Creating a mapping

The XSL mapping must be structured according to the following scheme. The global parameters to be used must first be declared in the stylesheet under their fully qualified name. They can then be used as usual.

Example: 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>

Modeling the Technical Process

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

  2. Drag the XSL mapping (see example) into the Technical Process.

  3. Save the Technical Process and then run it.