Branching in an interceptor lets you execute different logic depending on the outcome of some expression.

Example

If the SIS evaluates the following sample composition script for a particular IN call:

  • From the initial request, the SIS will invoke one of either InterceptorComponent1 or InterceptorComponent2, and InterceptorComponent3.

  • For any subsequence call events that Service1 is interested in receiving, the SIS will first invoke the interceptor extension component InterceptorComponent3 only, as the initial-dp variable is only present if the event being delivered is an InitialDP initial request.

VIA diagram

conditions interceptor

Script XML

<script>
 <invoke service="Service1">
   <service-input-interceptor>
     <if>
       <present variable="${initial-dp}"/>
       <then>
         <if>
           <equal a="${initial-dp.arg.service-key}" b="10"/>
           <then>
             <invoke-extension extension="InterceptorComponent1"/>
           </then>
           <else>
             <invoke-extension extension="InterceptorComponent2"/>
           </else>
         </if>
       </then>
     </if>
     <invoke-extension extension="InterceptorComponent3"/>
   </service-input-interceptor>
 </invoke>
</script>
Previous page Next page