不支持BPEL <switch>元素。</switch>

时间:2011-12-15 02:57:10

标签: switch-statement bpel

尝试在BPEL中使用<switch>元素时出现以下错误。

BPEL element in namespace 
"http://docs.oasis-open.org/wsbpel/2.0/process/executable" 
is not supported by this implementation.

我是否需要使用别的东西?它是从BPEL中删除的吗?

1 个答案:

答案 0 :(得分:2)

<switch>是BPEL 1.1的一部分,已在BPEL 2.0中删除。替换是<if>活动,可以按如下方式使用:

<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>

(摘自BPEL 2.0规范)

相关问题