Double-click the terminate activity.

Using Fault Handling in a BPEL Process 11-45 Example 11–32 Exit Activity sequence -- receive input from requestor -- receive name=receiveInput partnerLink=client portType=tns:Test operation=process variable=input createInstance=yes assign copy frominput.payloadfrom tooutput.payloadto copy assign -- respond output to requestor -- reply name=replyOutput partnerLink=client portType=tns:Test operation=process variable=output exit sequence

11.14 Throwing Faults with Assertion Conditions

You can specify an assertion condition that is executed upon receipt of a callback message in request-response invoke activities, receive activities, reply activities, and onMessage branches of pick and scope activities. The assertion specifies an XPath expression that, when evaluated to false, causes a BPEL fault to be thrown from the activity. This condition provides an alternative to creating a potentially large number of switch, assign, and throw activities after a partner callback. The assertion condition is specified as a nested extension element. Example 11–33 provides details. Example 11–33 Assertion Condition invoke | receive | onMessage standard-elements bpelx:postAssert name=ncname? expression=boolean-expr faultName=QName+ message=generic-expr+ invoke | receive | onMessage The bpelx:postAssert extension specifies the XPath expression to evaluate upon receipt of a callback message from a partner. If the assertion expression returns a false boolean value, the specified fault is thrown from the activity. If the assertion expression returns a true boolean value, no fault is thrown and the activities following the invoke activity, receive activity, or the onMessage branch of pick and scope activities are executed as in a normal BPEL process flow. The bpelx:preAssert or bpelx:postAssert extension is similar to the Java assert statement. In Java, if the assert expression does not evaluate to true, an error is reported by the JVM. Similarly, the expression in the bpelx:preAssert or bpelx:postAssert extension must evaluate to true; otherwise, the specified fault is thrown. For example, with the invoke activity shown in Example 11–34 , if the XPath expression specified in the assertion condition returns false, the NegativeCredit fault is thrown. Note: The assertion condition is only available in BPEL projects that support BPEL version 1.1