Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Enrich Mediator can process a message based on a given source configuration and then perform the specified action on the message by using the target configuration. It basically gets an OMElement using the configuration specified in the source and then modifies the message by putting it on the current message using the configuration in the target.

...

Table of Contents
maxLevel3
minLevel3
locationtop
styleborder:1
typeflat
separatorpipe

...

Syntax

Code Block
XML
XML

<enrich>
    <source \[clone=true\|false\] \[type=custom\|envelope\|body\|property\|inline\] xpath="" property="" />
    <target \[action=replace\|child\|sibiling\] \[type=custom\|envelope\|body\|property\|inline\] xpath="" property="" />
</enrich>

...

  • Clone - By setting the clone configuration, the message can be cloned or used as a reference during enriching. The default value is falsetrue.
    • True
    • False
  • Type - The type that the mediator uses from the original message to enrich the modified message that passes through the mediator.
    • Custom - Custom XPath value.
    • Envelope - Envelope of the original message used for enriching.
    • Body - Body of the original message used for enriching.
    • Property - Specifies a property.
    • Inline - Specifies an inline XML value.
  • XPath Expression

...

Info
titleNote

You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.

...

Example

Code Block
XML
XML

<enrich> xmlns="http://ws.apache.org/ns/synapse"
           <source clone="false" type="envelope" xpath="" property="" />
           <target action="replace" type="body" xpath="" property="" />
 </enrich>

In this example, we are setting the property symbol. Later, you can log it using the Log Mediator.

Excerpt
hiddentrue

Description of the Enrich Mediator in WSO2 ESB.