Skip to main content

Module chart

Module chart 

Source
Expand description

Chart versions, the chart registry, vt: extension lowering and migrations.

A chart version is the content address of the chart as written (vertep_rdf::chart_version over the IR before lowering), so the same chart loaded from SCXML or YAML has one version. The registry keeps every version by IRI, the versions of each chart type in registration order (the last is the latest) and the declared migrations.

Before compiling, lower rewrites the runtime’s vt: extensions into plain SCXML:

  • <vt:request target=".." event=".." timeout="5s" reply="s1" ontimeout="s2"/> in a state: a <send> of type vocab::REQUEST_SEND_TYPE on entry, a generated waiting substate, a transition on vt:reply and one on error.timeout. The runtime assigns the correlation id and journals the timeout as a durable timer.
  • <vt:reminder name=".." period=".." event=".."/> (or cancel="true") in executable content: a <send> of type vocab::REMINDER_SEND_TYPE.
  • <vt:migrate to=".." migration=".."/> in executable content: a <send> of type vocab::MIGRATE_SEND_TYPE, handled as a self-migration request.

vt:defer (on states), vt:unhandled (on <scxml>) and vt:restart* (on <invoke>) are read from the IR without rewriting it.

Structs§

ChartInfo
A registered chart version: the IR as written, the compiled lowered chart and what the runtime reads from its vt: extensions.
ChartRegistry
Every chart version an actor may run, keyed by version IRI, the versions of each chart type in registration order, and the declared migrations.
LowerError
Why a chart’s vt: extensions could not be lowered.
Migration
A declared migration between two chart versions: a configuration mapping and a datamodel transform. Configurations not listed explicitly map state by state through Migration::states, and a state not listed there maps to the state with the same id in the new version, if it has one (the derived identity mapping).
RestartPolicy
A vt:restart supervision policy of an <invoke>.

Enums§

RegisterError
Why a chart could not be registered.
RestartMode
When an invoked actor is restarted after it fails.
UnhandledPolicy
What to do with an external event that enables no transition and is not deferred.

Functions§

element_attributes
The attributes of the start tag of an extension element’s serialized XML.
find_state
The state with identifier id.
lower
Rewrites the runtime’s vt: extensions into plain SCXML (see the module docs), returning the lowered chart and the send types it introduced.
migrated_session
The session under to for active state ids ids, carrying the counters of old: compound states without an active child get their default entry, history and invocations start empty.
parse_duration
Parses a duration: a number followed by ms, s, min, h or d, or a bare number of milliseconds.
reachable_configurations
The configurations reachable in chart, ignoring guards (an over-approximation): every legal configuration of its state structure, as sets of state ids.
request_type
The send type of a vt:request with an optional timeout.
split_type
The parameters of a vt: send type: base;k=v;k2=v2 gives (base, {k: v, k2: v2}).
static_invoke_sources
Every <invoke> with a static src, as (state id, src).
unmapped_configurations
The configurations of from that m leaves unmapped into to; empty when the migration passes the compatibility check.

Type Aliases§

Transform
A datamodel transform of a migration.