Skip to content

Reference Eligibility expressions

A Reference Eligibility expression returns TRUE when Candidate may be assigned to the dependent Reference on Current. The server compiles the same expression for metadata dependency analysis and impact SQL.

This expression profile is used by validation, metadata authoring and activation, impact preview, Form and Table-filter candidate consumers, and authoritative API mutation validation.

  • Current.Field reads a direct persisted scalar on the source record.
  • Candidate.Field reads a direct persisted scalar on a possible target.
  • Current.Reference.Field reads one supported scalar through a direct, single-value Reference whose delete behavior is Restrict.
  • Candidate.Id reads the candidate identity. Current.Reference.Id and Candidate.Reference.Id read an admitted Reference’s id; a Reference cannot be used as a whole, and Candidate Reference traversal stops at its id.

Examples:

Current.Type = 'Feature' AND Candidate.Type IN ('Epic', 'Feature')
Candidate.Code = Current.Scope.Code
(Current.Type = 'Bug' AND Candidate.Type IN ('Feature', 'Task'))
OR (Current.Type = 'Feature' AND Candidate.Type IN ('Epic', 'Feature'))

Use AND, OR, NOT, and parentheses to compose cases. IN (...) is useful when one driver value permits several candidate values. Comparisons are type-checked: text compares with text, Select values use existing option keys, and numeric/date/time values use compatible values from the same family.

The profile admits compatible equality/ordering, IN/NOT IN with literal members, and BETWEEN with literal or Current bounds. It does not admit text-match operators or IS EMPTY. Candidate values other than the system Candidate.Id can use IS NULL/IS NOT NULL; Current null-driver checks and explicit NULL literals are rejected. Current dependencies require available values before the candidate context is ready.

The Entity Definition editor offers the same shared code editor and syntax help as other Moltaro expressions. Its simple designer inserts one compatible Candidate-to-Current equality or inequality. Use the code editor for multi-branch matrices; the editor preserves the expression text and the server remains the parser and type-checking authority.

The V1 profile deliberately rejects:

  • paths deeper than one Reference hop;
  • collection fields, child tables, and inverse references;
  • variables and functions;
  • raw SQL;
  • null-driver rules such as Current.Driver IS NULL;
  • Part, Association, and Projection traversal;
  • a dependent Reference or a traversed Current Reference that does not use Restrict (read available id-only operands from the authoring catalog).

Supported scalar operands are Bool, Integer, a valid Decimal, DateOnly, TimeOnly, DateTimeOffset, a bounded String, a Select with options, and a scalar Reference id. Text, read-only, calculated, deleted, collection, and malformed field shapes are not exposed as operands.

The profile limits expressions to 8 KiB UTF-8, 256 nodes, Boolean and source nesting depth 32, 100 members per IN list, and 16 distinct first members under each of Current and Candidate. Request IncludeAuthoring: true on validation for the actual paths, per-operand operators and comparison restrictions; see API authoring.

The validation endpoint returns stable codes plus the offending token or canonical path. See the Reference Eligibility configuration workflow for routes, impact behavior, concurrency, and activation.