journeys / journey-xml-5Markdown ↓

Inputs, state and values

$.inputs holds read-only launch context. Declare each launch input on the root with key, label and kind. Input kinds are text or resource. Resource inputs additionally specify resourceType and carry an object with id and label. Read the identifier through $.inputs.customer.id. A required input must be supplied when the Journey is launched; the declaration is not a form control.

$.state holds form answers and captured response values. A form field writes at its key. A schema form either writes each top-level property or, with outputKey, one whole object. Captures preserve the response JSON type. Do not store a resource label in an ID variable: read the object's id property.

Use {{ $.state.name }} in body, checklist and description text. Use ref="$.state.name" in an arg for a typed variable. These are different operations: display converts a value to text; a reference preserves numbers, booleans, objects and arrays. Do not interpolate a JSON variables string or add a :raw suffix.

A binding must be produced before the stage that consumes it. Form fields may refer to peers on the same form. Optional fields and conditional captures can be absent; the compiler warns when they are consumed. Presence tests avoid relying on a value that was never entered. Analysis is conservative: a nearby guard does not prove every later use safe. Dynamic schemas can prevent complete static member checking; runtime validation still matters.

Literal values default to strings. Explicit type values are string, number, boolean and null. Booleans must be true or false, numbers finite, and null must have no value. An arg may use a value attribute or text content, never both; a ref cannot also contain a literal. Do not use reserved keys proto, constructor or prototype.

The operations recipe demonstrates structured object and array variables. Names are required for members of variables and object; array items do not need names. Literal strings beginning with a $. path may be interpreted by the runtime as expressions; avoid using such text as an opaque literal input.

Published platform manual · revision d9a12320012a