XTend Documentation
Enable dark mode

XTend Developer Center

Build with XTend today

RMT Reference: Conditions and Expressions

tools/rmt-language/vnext-parser.js is the source of truth for operators and operand forms.

Conditions appear after when and use a small declarative expression language.

Syntax

OperatorFormAllowed contextsParametersFunctionDiagnosticsRelated operators
whenwhen app.ready == trueLifecycle, stream, event bindingcondition expressionEnables work only when the condition passes.Expression must be complete.mount, on
&&a == true && b == falseConditionleft and right expressionLogical AND.Right side must be an expression.``
```a == trueb == true`Conditionleft and right expressionLogical OR.Right side must be an expression.&&
!!app.disabledConditionexpressionNegates a boolean path or expression.Argument must be an expression.when
==app.status == "ready"Conditiontwo valuesEquality comparison.Both sides must parse.!=
!=app.status != "error"Conditiontwo valuesInequality comparison.Both sides must parse.==
>app.count > 0Conditiontwo valuesGreater-than comparison.Both sides must parse.>=
>=app.count >= 1Conditiontwo valuesGreater-than-or-equal comparison.Both sides must parse.>
<app.count < 10Conditiontwo valuesLess-than comparison.Both sides must parse.<=
<=app.count <= 10Conditiontwo valuesLess-than-or-equal comparison.Both sides must parse.<
()(app.ready == true)ConditionexpressionGroups logic.Closing parenthesis is required.&&, ``
trueapp.ready == trueCondition, primitive valueliteralBoolean true.Function calls are not allowed.false
falseapp.disabled == falseCondition, primitive valueliteralBoolean false.Function calls are not allowed.true
nullapp.value != nullCondition, primitive valueliteralNull value.Literal only.!=
Strings"ready"Condition, primitive valuequoted stringStatic text value.Strings need quotes.contract, message
Integers120Condition, primitive valueintegerNumeric value.Only integers are tokenized.durationMs, weight
Pathsapp.status.textCondition, payload, reducerqualified pathReferences state, input, detail, target or surface context.Path must contain identifier segments.payload, reduce

Allowed contexts

Conditions appear after when. Literals and paths also appear in primitive values, payload mappings and reducer expressions.

Parameters

Conditions allow paths, strings, integers, true, false, null, comparisons, !, &&, || and parentheses.

Description

The condition language is intentionally smaller than JavaScript. It allows decisions, but not function calls or free execution.

Examples

template reference.conditions {
  state app.ready type boolean initial true
  state app.disabled type boolean initial false
  state app.count type number initial 2
  portal app.root root "#app" layer surface

  surface shell kind page component x-section {
    portal app.root
    lane visible weight 80 {
      mount shell.card from endpoint app.card when (app.ready == true && !app.disabled) || app.count >= 1
    }
  }
}

Diagnostics

Function calls such as isReady() are not allowed and produce parser diagnostics. Missing parentheses or incomplete comparisons are also reported.

when, mount, stream, on, payload, reduce.

The RMT reference index shows which records accept conditions and expressions. Related article

(c) 2026 - CCS Networks | Powered by XRouter PHP Extension