Time for action – adding fault handlers
The steps for adding fault handlers are as follows:
We check the content of the input message before preparing the request to the query services. The
<if>
activity can be used to check the content of input and get an action based on the result. So let's drag-and-drop a new<if>
activity in between the<receive>
and<assign>
activities that prepare the request message to the query service:Now, let's add the content verification logic as the condition in the
<if>
activity. Click on theif
case in the<if>
activity and use XPath Expression Builder to generate the expression in the box named Condition:Now, if the condition is
true
, the activity defined within the<if>
case is executed. So let's generate a fault within the<if>
case. In WS-BPEL 2.0, to generate a fault, the<throw>
activity is used. Drag-and-drop a<throw>
activity within the<if>
case, as follows:The next step is to configure...