=================================
  Apache ODE - JS/E4X Extension
=================================

This extension provides support for JavaScript/E4X expressions in BPEL
extension activities and/or BPEL extensible assign operations.

How to install
==============
    1.) Copy ode-extensions-e4x-*.jar and extensions/ode-extensions-e4x/lib/* in ODE's class path and
    register the extension bundle by adding the following line to
    ODE's configuration file.

    For ODE/Axis2: ode-axis2.properties
    ode-axis2.extension.bundles.runtime = org.apache.ode.extension.e4x.JSExtensionBundle

    For ODE/JBI: ode-jbi.properties
    ode-jbi.extension.bundles.runtime = org.apache.ode.extension.e4x.JSExtensionBundle

    2.) Start/restart ODE.

How to use
============
    1.) Declare the extension namespace in BPEL by adding the following snippet
    before the first activity.

    <bpel:extensions>
        <bpel:extension namespace="http://ode.apache.org/extensions/e4x"
                mustUnderstand="yes"/>
    </bpel:extensions>

    2a.) Use JS/E4X in <assign> activities:

    <assign name="e4x-assign">
        <extensionAssignOperation>
            <js:snippet>
                myVar.TestPart += ' World';
            </js:snippet>
        </extensionAssignOperation>
    </assign>

    2b.) Use JS/E4X in <extensionActivity> activities:

    <extensionActivity name="calculateDiscount">
        <js:snippet>
            if (goldRatio > 1.0 || silverRatio > 1.0) {
                throwFault('urn:myprocess', 'IllegalArgumentFault',
                        'discount ratios must be <= 1.0');
            }
            if (customer.type == 'gold') {
                po.items.item.price *= goldRatio;
            } else if (customer.type = 'silver') {
                po.items.item.price *= silverRatio;
            } else if (customer.type = 'besteffort') {
                po.shippingMode = 'snailmail'
            }
        </js:snippet>
    </extensionActivity>
