Setting Dynamic Parameters
How can I set parameters dynamically?
In a technical process, you can set parameters dynamically to control process modules depending on the processed data and, if necessary, overwrite parameters already set at process runtime.
Dynamic parameters are generated using XSL mappings that output specific processing instructions. These processing instructions are processed by a subsequent process component (e.g.To do this an adapter).
To do this, you have several options:
- Set parameters via single XSL mapping: Here you can create a single XSL data mapping that transforms XML data and contains dynamic processing instruction definitions at the same time.
- Parameterize dynamically without data transformation: You can also create a separate XSL mapping that generates processing instructions only.
Note
Observe the following prioritization when using Component Parameters and setting parameters dynamically:
- Component parameters overwrite the configuration of process modules in the repository (for example, function adapters) at process runtime.
Dynamic parameters overwrite set parameters (global, project and system parameters) as well as the configuration of process modules in the repository (for example, function adapters) at process runtime.
Setting Parameters Dynamically via XSL Mappings
Place an XSL mapping before the adapter or database connection to be parameterized in the Technical Process.
Define a processing instruction in the XSL mapping according to the following pattern:
<xsl:processing-instruction name="DynamicParameter">ParameterName=" ParameterValue "</xsl:processing-instruction>.
Replace
ParameterName
with the required parameter name.Replace
ParameterValue
with a value, in most cases using an XSL instruction.If the XSL mapping shall create dynamic parameters only, define an additional processing instruction
<xsl:processing-instruction name="NoResult"/>
. As a result, the XSL mapping will not produce an output document.
Note
The XSL mapping must generate a root element in each case in order to be able to execute the mapping.
Parameterizing Dynamically without Data Transformation
If you want to hand over an input document without transformation to a dynamically parameterized adapter, insert a Fork
component into a Technical Process diagram:
- In the first branch, set the XSL mapping according to the above described procedure.
- In a second branch, set the process component to be handed over.
- Place the adapter right after the
Join
component.
Example
A file name stored inside an XML document is handed over to a File system transfer adapter as dynamic parameter.
In this example, the XSL mapping contains the following code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/" version="1.1">
<xsl:output method="xml" media-type="text/xml"/>
<xsl:template match="/">
<xsl:processing-instruction name="DynamicParameter">path="
<xsl:value-of select="data"/>"
</xsl:processing-instruction>
<xsl:processing-instruction name="NoResult"/>
<root/>
</xsl:template>
</xsl:stylesheet>
Dynamic Parameters with DynamicParameter
With XSL mappings, you can control the process execution at runtime. An XSL mapping implements the logic to customize the configuration of adapters, transfers, and database connections. Depending on the processed data, custom parameter values can be set. Those custom parameter values will be processed by the following adapter or database process component and overwrite parameter values set in the component.
Creating Parameter Values
To set parameter values within Technical Processes dynamically, create an XSL mapping that produces a specific Processing Instruction which will be handed over to the following process component and will be interpreted.
<xsl:processing-instruction name="DynamicParameter">
parameterName="parameterValue"</xsl:processing-instruction>
Output of the XSL mapping:
<?DynamicParameter parameterName="parameterValue" ?>
Parameters and parameter values
In the XSL mapping, you can define any number of different parameters and corresponding values:
parameterName
: Name of the parameter to be overwrittenparameterValue
: Parameter value to be overwritten; always inside of quotation marks
Note
Please note that the XSL mapping must generate a well-formed XML document providing a root element, in order to be able to execute the XSL mapping.
Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output encoding="UTF-8" method="xml" indent="yes" version="1.0"/>
<xsl:template match="/">
<xsl:processing-instruction
name="DynamicParameter">key="i"</xsl:processing-instruction>
<root/>
</xsl:template>
</xsl:stylesheet>