Common
HomeIntegrityControlSolutionsManagement Center
Expressions
Expressions
  • Introduction
  • Expansion
  • Typed expansion
  • Advanced expansion
  • Predicates
  • Extensions
    • str
    • mv
    • ipv4
    • dbg
Powered by GitBook
On this page
  • Introduction
  • Syntax
  • Extensions
  • Scopes
Export as PDF

Predicates

Introduction

Predicates are boolean JavaScript expressions that must return either true or false.

Predicates are primary used for controlling execution and for filtering and are always evaluated during runtime.

Context data that can be used in the expression are available in scopes, defined by the current context. Scopes follow the same structure as for expansion, but using JavaScript types.

Syntax

A predicate MUST:

  • be a string ("...")

  • be valid JavaScript (ECMAScript 2023)

  • evaluate to a boolean value (true/false) or a function that returns a boolean value

// Simple predicate that is always true
{
    "predicate": "true",
}

Since predicates are JavaScript all features of JavaScript are supported including, but not limited to:

  • operators (==, !=, >, >=, <, <=)

  • strict operators (===, !==)

  • array indexing using bracket notation (arr[3])

  • property access using bracket notation (obj['property-name'])

Extensions

Scopes

Scopes are the named top level objects containing context data (for example request or session). Available scopes depends on the context.

Data in scopes are accessed different depending on the type of objects included in the path, but adheres to the rules of JavaScript.

PreviousAdvanced expansionNextExtensions

Last updated 11 months ago

For more information about JavaScript, see:

Extensions are libraries containing useful functions when working with predicates. For more information, see:

https://developer.mozilla.org/en-US/docs/Web/JavaScript
Extensions