Skip to content

Assert

mapping category: assertion no `||`

Fails the record unless the input matches a value or one entry of an array of values.

Takes either a single parameter that the input must match or an array of parameters. The input must match one of the supplied values; otherwise the rule fails and the record is dropped. An optional comment is written to the log when the assertion does not match.

Parameters

1expected Mandatory — accepts: BOOLEAN, DATE, FLOAT, INT, STRING, NULL, array

A value the input must match, NULL, or an array of values with the same type as the input. The input must equal one of these values.

2comment Optional — accepts: STRING

A comment written to the log when the assertion does not match.

Input type

  • BOOLEAN
  • DATE
  • FLOAT
  • INT
  • STRING

Output type

  • same-as-input

Examples

Match a single value with comment

Assert("Error state", "An error state was entered")

Assert input is NULL

Assert(NULL)

Match any of an array of values

Assert([0.0, 0.1, 0.2], "Out of limits")

See also

AssertNot, AssertVocabDomain