Search code examples
web-servicessoabpel

BPEL variables initialisation


Is it possible to initialize BPEL variables at the declaration ? if so how ?

declaration example :

<variables>
    <variable name="offer" type="xsd:float"/>
    <variable name="response" type="xsd:string"/>
</variables> 

Solution

  • This is possible. BPEL 2.0 allows a from-spec directly in the variable declaration. However, this feature is not implemented by all BPEL engines, e.g. Apache ODE cannot handle such inline initializations.

    The following snippet is valid BPEL 2.0:

    <variables>
        <variable name="response" type="xsd:string">
            <from>'TocToc'</from>
        </variable>
        <variable name="offer" type="xsd:float">
            <from>100</from>
        </variable>
    </variables>
    

    For an example, please see page 121 in [1] and section 8.1 (page 45) of [1] for the definition.

    [1] http://docs.oasis-open.org/wsbpel/2.0/wsbpel-v2.0.pdf