Skip to main content
Skip table of contents

Using And/Or and AndAnd/OrOr in Rule Sets

This guide explains the difference between the logical operators And/Or and AndAnd/OrOr in eADM rule sets and provides recommendations on when to use each type.

While the operators can be confusing, a simple guideline is that AndAnd and OrOr provide better performance and are recommended for simple rule sets where you are not mixing conditions.


Operator Definitions

AndAnd / OrOr (Short-Circuit Operators)

The AndAnd and OrOr operators evaluate rules sequentially and stop processing as soon as the overall result can be determined. This is also known as short-circuit evaluation.

  • AndAnd: If you have a rule A AndAnd B, and condition A evaluates to false, the system will not evaluate condition B because the entire expression can never be true.

  • OrOr: If you have a rule A OrOr B, and condition A evaluates to true, the system will not evaluate condition B because the entire expression will always be true.

Note: Using these operators results in faster processing and is the recommended best practice for simple rule sets.

And / Or (Standard Operators)

The And and Or operators evaluate every rule in the set before returning a final answer. These are used for more complex scenarios where you need to combine different sets of criteria.


Best Practices and Examples

Case 1: Using Only "AND" Logic

If your rule set only contains AND conditions, you should use AndAnd for every rule. This provides the best performance.

Example: A user gets an App-Microsoft365-A3 license if:

  • Their department number is in a specific list, AND

  • Their position type is F or V, AND

  • Their account is not deactivated.

Case 2: Using Only "OR" Logic

If your rule set only contains OR conditions, you should use OrOr for every rule to gain a similar performance benefit.

Example: A user gets an M365-E5 license if:

  • Their department number is 3705 or 1125, OR

  • Their title is Director, Consultant, or Specialist, OR

  • They are a manager for someone.

Case 3: Combining "AND" and "OR" Logic

When you need to mix AND and OR logic, you should use OrOr to separate different sets of criteria, and And to link the rules within each individual set.

In the example below, the rule set consists of two distinct criteria groups separated by OrOr. A user gets the App-Office365-E3 license if they meet the conditions in Group 1 OR the conditions in Group 2.

  • Group 1 (Lines 1-2):

    • Department number is in a specific list.

    • AND the account is not deactivated.

  • Group 2 (Lines 3-5):

    • The user is a manager.

    • AND the organizational chart does not start with "6000".

    • AND the account is not deactivated.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.