bpelx:postAssertおよびbpelx:preAssert拡張要素

アクティビティに応じて、条件を実行するタイミングを指定するには、invokeアクティビティ、receiveアクティビティ、replyアクティビティ、およびpickアクティビティとscopeアクティビティのonMessageブランチの「アサーション」タブで「追加」アイコンをクリックし、「アサート前」または「アサート後」を選択します。選択内容に基づいて、次のbpelx拡張要素が使用されます。

  • bpelx:preAssert: 「アサート前」を選択すると、invokeアクティビティまたはreplyアクティビティがアウトバウンド・メッセージを送信する前に条件が実行されます。

  • bpelx:postAssert: 「アサート後」を選択すると、invokeアクティビティ、receiveアクティビティまたはonMessageブランチがインバウンド・メッセージを受信した後に条件が実行されます。

次の例は、BPEL 1.1におけるreceiveアクティビティ内の複数のbpelx:postAssert拡張要素を示しています。

       <receive name="Receive_1" createInstance="no"
            variable="Receive_1_processResponse_InputVariable"
            partnerLink="AsyncBPELService"
            portType="ns1:AsyncBPELServiceCallback"
            bpelx:for="'PT10S'"
            operation="processResponse">
         <bpelx:postAssert name="assert1" expression="true()" message="'assert
 true failed'" faultName="client:fault1"/>
         <bpelx:postAssert name="assert2" expression="false()" message="'assert
 false failed'" faultName="client:fault2"/>
       </receive> 

次の例に、BPEL 1.1におけるinvokeアクティビティ内の複数のbpelx:preAssert拡張要素を示します。

<invoke name="Invoke_1" inputVariable="Invoke_1_process_InputVariable"
           outputVariable="Receive_1_processResponse_InputVariable"
           partnerLink="SyncBPELService" portType="ns1:SyncBPELService"
           operation="process">
         <bpelx:preAssert name="assert1" expression="true()" message="'assert true
 failed'"/>
         <bpelx:preAssert name="assert2"
 expression="bpws:getVariableData('counter') = 3" message="concat('The value of
 counter is ', $counter)"/> 

「アサーション」タブの使用の詳細は、「アサーション条件の作成方法」を参照してください。