Contact Free trial Login

And/Or/Not Logic Filters

Allows filtering of messages using And/Or/Not logic expressions.

Minimum Configuration: None.

Filter Configuration

Logic filters apply the And, Or, Not logic to one or more nested filters that they enclose. When you use these logic filters, you add nested filters to them from within the nested pane for the And, Or, Not filter.

  1. In Anypoint Studio, search for "logic" and drag the Filter Reference block to the Canvas.

  2. Click the processor to open the properties editor:

    filter properties
  3. Click the green plus sign to the right of Global Reference.

  4. Click the down arrow for Filters to show the filter selections:

    filter global type
  5. Click And and OK.

  6. Click the green plus sign below And-Filter Nested:

    and filters

Use the And Filter to combine two or more filters. The And Filter accepts the message and returns true only if all of its enclosed filters return true.

The Or Filter returns true if any of its enclosed child filters return true. That is, it accepts the message if the message matches the criteria of any of its filters.

The Not Filter inverts its enclosed filter. That is, the Not Filter accepts the message and returns true if the message does not match the filter criteria. For example, if the enclosed filter normally returns true for a specific message, when nested within the Not filter it returns false.

Example Code

Code sample to create an And filter:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:http="" xmlns="" xmlns:doc=""
    <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
    <and-filter name="And" doc:name="And">
    <flow name="add_logicFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
        <filter ref="And" doc:name="Filter Reference"/>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.