bpelx:postAssert and bpelx:preAssert Extensions
Depending upon the activity, you can specify when to execute a condition by clicking the Add icon in the Assertions tab of invoke, receive, reply, and onMessage branches of pick and scope activities, and selecting either Pre Assert or Post Assert. Based on your selection, the following bpelx
extensions are used:
-
bpelx:preAssert
: If you select Pre Assert, the condition is executed before the invoke or reply activity send out the outbound message. -
bpelx:postAssert
: If you select Post Assert, the condition is executed after an invoke activity, receive activity, or onMessage branch receives the inbound message.
The following example shows multiple bpelx:postAssert
extensions in a receive activity in BPEL 1.1:
<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>
The following example shows multiple bpelx:preAssert
extensions in an invoke activity in BPEL 1.1:
<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)"/>
For information on using the Assertions tab, see How to Create Assertion Conditions.