Edit

Share via


And

Removes the top two items from the stack, performs a Boolean AND of the two items, and then pushes the result onto the stack.

Syntax

  
<ic:Operation Name="And" />  

Parameters

Top two items on the stack.

Pushed Value

String result of the Boolean AND operation.

Remarks

Example

The And operation is useful when you need to evaluate multiple statements. The following example filter expression checks whether the activity name is "CheckPO" and the activity event is closed by using the And operation.

<ic:Filter>  
  <ic:Expression>  
    <wf:Operation Name="GetActivityName"/>  
    <ic:Operation Name="Constant">  
      <ic:Argument>CheckPO</ic:Argument>  
    </ic:Operation>  
    <ic:Operation Name="Equals"/>  
    <wf:Operation Name="GetActivityEvent"/>  
    <ic:Operation Name="Constant">  
      <ic:Argument>Closed</ic:Argument>  
    </ic:Operation>  
    <ic:Operation Name="Equals"/>  
    <ic:Operation Name="And"/>  
  </ic:Expression>  
</ic:Filter>  

In this example And is the final operation in the expression because it relies on the results of the comparisons (and pops them from the stack to perform the comparison). You can extend this idea to perform And operations on more than two items. For example, to evaluate whether Condition A and Condition B and Condition C are true, you would use an expression like the following:

<ic:Filter>  
  <ic:Expression>  
    <wf:Operation Name="GetActivityName"/>  
    <ic:Operation Name="Constant">  
      <ic:Argument>CheckPO</ic:Argument>  
    </ic:Operation>  
    <ic:Operation Name="Equals"/>  
    <wf:Operation Name="GetActivityEvent"/>  
    <ic:Operation Name="Constant">  
      <ic:Argument>Closed</ic:Argument>  
    </ic:Operation>  
    <ic:Operation Name="Equals"/>  
    <wf:Operation Name="GetActivityType"/>  
    <ic:Operation Name="Constant">  
      <ic:Argument>MyType</ic:Argument>  
    </ic:Operation>  
    <ic:Operation Name="Equals"/>  
    <ic:Operation Name="And"/>  
    <ic:Operation Name="And"/>  
  </ic:Expression>  
</ic:Filter>   

See Also

Interceptor Operations