The Call Template mediator allows you to construct a sequence by passing values into a sequence template.
Info |
---|
This is currently only supported for special types of mediators such as the Iterator and Aggregate Mediators, where actual XPath operations are performed on a different SOAP message, and not on the message coming into the mediator. |
Syntax
Code Block |
---|
<call-template target="string"> <!-- parameter values will be passed on to a sequence template --> ( <!--passing plain static values --> <with-param name="string" value="string" /> | <!--passing xpath expressions --> <with-param name="string" value="{string}" /> | <!--passing dynamic xpath expressions where values will be compiled dynamically--> <with-param name="string" value="{{string}}" /> | ) * <!--this is the in-line sequence of the template --> </call-template> |
...
When a target template is selected, the parameter section will be displayed as shown below if the sequence template selected has any parameters.
...
. This enables parameter values to be parsed into the sequence template selected.
Parameter Name | Description |
---|---|
Parameter Name | The name of the parameter. |
Parameter Type | The type of the parameter. Possible values are as follows.
|
Value / Expression | The parameter value. This can be a static value, or an XPath expression to calculate a dynamic value depending on the value you selected for the Parameter Type parameter. |
Action | Click Deleteto delete a parameter. |
Example
The following four Call Template mediator configurations populate a sequence template named HelloWorld_Logger with the "hello world" text in four different languages.
Code Block | ||
---|---|---|
| ||
<call-template target="HelloWorld_Logger">
<with-param name="message" value="HELLO WORLD!!!!!!" />
</call-template> |
Code Block | ||
---|---|---|
| ||
<call-template target="HelloWorld_Logger">
<with-param name="message" value="Bonjour tout le monde!!!!!!" />
</call-template> |
Code Block | ||
---|---|---|
| ||
<call-template target="HelloWorld_Logger">
<with-param name="message" value="Ciao a tutti!!!!!!!" />
</call-template> |
Code Block | ||
---|---|---|
| ||
<call-template target="HelloWorld_Logger">
<with-param name="message" value="???????!!!!!!!" />
</call-template> |
The sequence template can be configured as follows to log any greetings message passed to it by the Call Template mediator. Thus, due to the availability of the Call Template mediator, you are not required to have the message entered in all four languages included in the sequence template configuration itself.
Code Block |
---|
<template name="HelloWorld_Logger">
<parameter name="message"/>
<sequence>
<log level="custom">
<property name=”GREETING_MESSAGE” expression=”$func:message” />
</log>
</sequence>
</template> |
See Sequence Template for a more information about this scenario.