<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>WSO2 ESB - Enrich Mediator </title>
  <link href="css/esb-docs.css" rel="stylesheet" />
  <link href="styles/dist-docs.css" rel="stylesheet" type="text/css"
  media="all" />
</head>

<body>
<h2>Enrich Mediator</h2>

 <p>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 modify the message by putting it on the current message using the configuration
in the target.
</p>

<p></p>

<h3>Syntax</h3>
    <pre xml:space="preserve"> &lt;enrich&gt;
       &lt;source [clone=true|false] [type=custom|envelope|body|property|inline] xpath="" property="" /&gt;
       &lt;target [action=replace|child|sibiling] [type=custom|envelope|body|property|inline] xpath="" property="" /&gt;
 &lt;/enrich&gt;</pre>

<p></p>

<h3>UI Configuration</h3>

<p><img src="../enrich-mediator/docs/images/enrich_mediator_screenshot.png"
alt="" /> </p>

<p><strong>Enrich Mediator Screenshot</strong> </p>

<p>You have the following configuration under the Enrich mediator. </p>

    <ul>
        <li><strong>Source Configuration</strong>
            <ul>
              <li>Clone : By setting the clone configuration, the message can be cloned or
                  else use as a reference during the enriching. The default value for
                  clone is false.
                  <ul>
                    <li>True/False</li>    
                  </ul>
              </li>
              <li>Type : Specifies that the type that the mediator use from the original message to enrich the modified
                  message that pass through the mediator.
                  <ul>
                    <li>Custom : Custom XPath value
                    <p>If there are any namespaces involved in the XPath expression, you
                        can specify it in the Namespace Editor. </p>
                        <img src="../enrich-mediator/docs/images/namespaces_screenshot.png" alt="" />
                        <p><strong>Namespace Editor Screenshot</strong> </p>
                    </li>
                    <li>Envelope : Envelope of the original message will be used for enriching.
                    </li>
                    <li>Body : Body of the original message will be used for enriching.</li>
                    <li>Property : Specifies a property.</li>
                    <li>Inline : Specifies an inline XML value</li>
                  </ul>
              </li>
            </ul>
        </li>
        <li><strong>Target Configuration</strong>
            <ul>
              <li>Action : By specifying the action type the relevant action can be applied to outgoing message.                  
                  <ul>
                    <li>Replace : Replace the xml message based on the target type specified on the target configuration.</li>
                    <li>Child : Adding as a child of specified target type.</li>
                    <li>Sibling : Adding as a sibling of specified target type.</li>  
                  </ul>
              </li>
              <li>Type : Specifies that the type of enriching the outgoing message.
                  <ul>
                    <li>Custom : Custom XPath value.
                    <p>If there are any namespaces involved in the XPath expression, you
                        can specify it in the Namespace Editor as in the Source Configuration.</p>
                    </li>
                    <li>Envelope : Envelope of the original message will be used for enriching.
                    </li>
                    <li>Body : Body of the original message will be used for enriching.</li>
                    <li>Property : Specifies a property.</li>
                  </ul>
              </li>
            </ul>
        </li>
    </ul>

<h3>Example</h3>
    <pre xml:space="preserve"> &lt;enrich&gt; xmlns="http://ws.apache.org/ns/synapse"
           &lt;source clone="false" type="envelope" xpath="" property="" /&gt;
           &lt;target action="replace" type="body" xpath="" property="" /&gt;
 &lt;/enrich&gt;</pre>


<p>In this example we are setting the property symbol and later we are logging
it using the log mediator.</p>

<p></p>
</body>
</html>
