Skip to content

JumpIf

control category: control-flow no `||` resultSize: 1

Jumps to a named Mark when the input value equals the given parameter.

JumpIf is part of the imperative control-flow cluster. It accepts a single pipeline input and compares it against a literal value. When the comparison succeeds, execution skips ahead to the Mark(...) rule with the matching name; otherwise the chain continues normally. The input value is passed through unchanged regardless of whether the jump fires.

Use it to short-circuit branches that do not need further processing — e.g. when a default has already been chosen and downstream lookups are unnecessary.

Parameters

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

The literal compared against the input value. Its type must match the input's type (or be NULL).

2mark Mandatory — accepts: STRING

The name of the destination Mark to jump to.

Input type

  • BOOLEAN
  • DATE
  • FLOAT
  • INT
  • STRING

Output type

  • same-as-input

The input value is passed through unchanged.

Requires

  • Exactly one pipeline input.
  • Parameter type must match the input type (or be NULL).
  • The destination Mark must exist in the same chain.

Examples

Jump past default branch when concept already resolved

:visit_concept => JumpIfNot(9202, "Default") => :visit_concept

Used together with JumpTo and Mark to form an if/else (see test053).

Errors

  • JumpIf got too many inputs
    More than one value reached the rule. JumpIf accepts a single input.
  • JumpIf accepts input of types: INTEGER, STRING, FLOAT, DATE, or BOOLEAN
    An unsupported input type (e.g. ARRAY) was supplied.
  • JumpIf requires the type of the input and the type of the parameter to be identical
    The literal value's type does not match the input field's declared type.

See also

JumpIfNot, JumpTo, Mark