I get the following error when trying to use a <switch>
element in BPEL.
BPEL element in namespace
"http://docs.oasis-open.org/wsbpel/2.0/process/executable"
is not supported by this implementation.
Do I need to use something else instead? Was it removed from BPEL?
<switch>
was part of BPEL 1.1 and has been removed in BPEL 2.0. The replacement is the <if>
activity, which can be used as follows:
<if xmlns:inventory="http://supply-chain.org/inventory" xmlns:FLT="http://example.com/faults">
<condition>
bpel:getVariableProperty('stockResult','inventory:level') > 100
</condition>
<flow>
<!-- perform fulfillment work -->
</flow>
<elseif>
<condition>
bpel:getVariableProperty('stockResult','inventory:level') >= 0
</condition>
<throw faultName="FLT:OutOfStock" variable="RestockEstimate" />
</elseif>
<else>
<throw faultName="FLT:ItemDiscontinued" />
</else>
</if>
(snippet is borrowed from the BPEL 2.0 spec)