Getriebe expression dialect v1
The language identifier is
https://tokenjanitor.github.io/getriebe/languages/expression/v1.
This page specifies the implementation-independent expression contract for
DATA-003. The dialect borrows syntax from
FEEL and defines its own types, arithmetic and supported constructs.
Language selection
The compiler takes the source, its effective language and the declared types of the available process fields. It accepts only the identifier above. An embedding that requires a particular result type supplies it at compile time. XOR and loop conditions require a boolean result.
For a BPMN formal expression,
resolve the expression’s language override, then the Definitions
expressionLanguage, then the BPMN default of XPath. When a model requires an
expression to be evaluated, deployment must diagnose an unsupported effective
language. A direct data association may be supported without an expression.
This is the integration contract. See
OMG BPMN 2.0.2, §8.2.1 and §8.4.6,
Tables 8.1 and 8.43.
A Script Task selects this dialect with
scriptFormat="application/vnd.getriebe.expression-v1". Its available field
names come from its declared inputs and its expected type comes from its
single output.
Syntax and types
| Construct | Syntax and result type |
|---|---|
| Literals | true and false are booleans. Strings use JSON double quotes and escapes. A base-ten integer such as 42 or -42 is a long. A number with a decimal point such as 42.0 is a decimal. Exponents are outside the dialect. |
| Field reads | A case-sensitive name refers to a declared field and has its declared type. Use a simple identifier such as invoice_total for portable models. Field paths and nested data are outside the dialect. |
| Grouping | Parentheses enclose one expression and preserve its type. |
| Arithmetic | Unary + and -, binary +, -, * and / take numbers. Binary arithmetic on two longs returns a long. A decimal operand makes the result a decimal. |
| Comparison | =, !=, <, <=, > and >= compare numeric values and return boolean. = and != also compare two strings or two booleans. String equality compares the actual string values, without case folding or Unicode normalization. |
| Boolean operations | and, or and not(value) take booleans and return boolean. |
| Boolean collection | all(values) takes a boolean collection and returns true when every value is true. An empty boolean collection gives true. A parallel review requires a nonempty input independently of this expression. |
| Explicit rounding | round_div_half_up(a, b, scale) and round_div_half_even(a, b, scale) take two numbers and a nonnegative long scale. Both return decimal. |
Parentheses and calls bind most tightly, then unary signs, multiplication and
division, addition and subtraction, comparisons, and, and or. Binary
arithmetic of equal precedence groups from the left. Use parentheses to
make the grouping explicit.
The available operations are pure and deterministic. General function calls, exponentiation, collection literals and comparisons, contexts, temporal values and external effects are outside the dialect. An expression has no access to the clock, random values, storage, a network or host functions.
The Resource Parameter Binding on a parallel Multi-Instance User Task
has a separate expression context. Its complete expression has the form
lookup(localItem, "key", "resourceId", ...). The first argument names the
local string input item. Each following key and target is a string literal.
Keys are unique and every target is the ID of a declared unparameterized
BPMN Resource. The lookup compares exact strings. Deployment resolves all
targets, and activation requires a matching key for every input item.
Evaluation and limits
Numeric operations obey DATA-002.
Promotion from long to decimal is exact. Long division requires an integral
result and decimal division requires an exact result within the supported
bounds. Explicit rounded division rounds to the number of fractional
places requested. Ties in HALF_UP round away from zero, while ties in
HALF_EVEN round to the even neighbor. For example,
round_div_half_up(-2.5, 1, 0) is decimal -3 and
round_div_half_even(-2.5, 1, 0) is decimal -2.
Compilation checks syntax, field declarations and operand types on both
sides of a boolean operator. Evaluation of and skips its right side when
the left is false. Evaluation of or skips its right side when the left is
true. An evaluated read of an unset field fails, as does an actual field
value of the wrong type. Numeric errors include overflow, division by zero
and inexact division. A failed condition propagates an execution error
under WF-003.
The TypeScript MVP compiler limits source length to 4,096 UTF-16 code units, the parsed tree to 1,024 nodes and compilation depth to 64. These are implementation limits and exceeding them produces an error. Its number implementation accepts the signed 64-bit long range and at most 128 integer and 128 fractional digits in a normalized decimal. A rounded division scale must be between 0 and 128 inclusive in this implementation.
Evidence
The TypeScript library tests cover the language boundary, type and syntax rejection, short-circuit evaluation, exact values and arithmetic errors, including negative rounding ties. These tests exercise standalone compilation and evaluation. Formal results and end-to-end claims are tracked in the evidence index.