State machine: Zustand lesen (Current state / Is in state) #57

Closed
opened 2026-09-12 18:02:39 +02:00 by meleki · 1 comment
Owner

Aus #51 fehlt noch der Daten-Weg zum Zustand: Heute gibt es nur State branch (Exec) und Set state. Für Vergleiche, Texte, Debug-Ausgaben und Bedingungen braucht es den Zustand als Wert.

Vorschlag:

  • Current state: machine rein (Picker/Literal), Text raus – Name des aktuellen Zustands, "" wenn keiner. (Alternativ Id; der Name ist für Join/Text das Nützliche, die Id für Vergleiche stabil – vielleicht beides als zwei Ausgänge.)
  • Is in state: machine rein, ein Boolean-Ausgang pro Zustand (abgeleitet wie statePorts, aber Typ boolean) – die Daten-Variante von State branch, direkt an Branch/And anschließbar.

Beide sind reine Leser (category: data), brauchen ctx.states wie State branch. Tests analog zu state-machine.test.ts (kein Zustand → leer/false, fremder Zustand → leer/false).


Folge-Issue zu #51 (State machine, Commit e7d82bd, 2026-09-12).

Aus #51 fehlt noch der **Daten-Weg** zum Zustand: Heute gibt es nur `State branch` (Exec) und `Set state`. Für Vergleiche, Texte, Debug-Ausgaben und Bedingungen braucht es den Zustand als Wert. **Vorschlag:** - `Current state`: `machine` rein (Picker/Literal), **Text** raus – Name des aktuellen Zustands, `""` wenn keiner. (Alternativ Id; der Name ist für `Join`/`Text` das Nützliche, die Id für Vergleiche stabil – vielleicht beides als zwei Ausgänge.) - `Is in state`: `machine` rein, **ein Boolean-Ausgang pro Zustand** (abgeleitet wie `statePorts`, aber Typ `boolean`) – die Daten-Variante von `State branch`, direkt an `Branch`/`And` anschließbar. Beide sind reine Leser (`category: data`), brauchen `ctx.states` wie `State branch`. Tests analog zu `state-machine.test.ts` (kein Zustand → leer/false, fremder Zustand → leer/false). --- Folge-Issue zu #51 (State machine, Commit `e7d82bd`, 2026-09-12).
meleki added the state-machine label 2026-09-12 18:02:39 +02:00
admin added the low-priority label 2026-09-12 18:11:10 +02:00
admin added this to the Development project 2026-09-13 13:29:59 +02:00
admin removed this from the Development project 2026-09-13 13:30:59 +02:00
admin added this to the Development project 2026-09-13 13:45:43 +02:00
admin moved this to Next in Development on 2026-09-14 21:44:18 +02:00
Author
Owner

Done in 7babf88.

Two pure readers, no exec ports, answered whenever they are asked:

  • Current state with two outputs: name for showing (Join, a Text object) and id for comparing, because a rename moves the name but never the id. Both empty while the machine is in no state; a state the machine does not know keeps its id but has no name.
  • Is in state with one boolean output per state — the data twin of State branch, for the places a flow cannot go (Branch, And, a property row). Every output is answered, so a state nobody is in reads false rather than nothing.

Both take a machine input like the other machine nodes.

One thing this needed underneath: a node with no run did not exist before. read learned def and lookup, and the node catalog test knows this third kind of node now, next to events and flow.

Wiki: 84df59c, State machines.

Done in 7babf88. Two pure readers, no exec ports, answered whenever they are asked: - **`Current state`** with two outputs: `name` for showing (`Join`, a `Text` object) and `id` for comparing, because a rename moves the name but never the id. Both empty while the machine is in no state; a state the machine does not know keeps its id but has no name. - **`Is in state`** with **one boolean output per state** — the data twin of `State branch`, for the places a flow cannot go (`Branch`, `And`, a property row). Every output is answered, so a state nobody is in reads `false` rather than nothing. Both take a `machine` input like the other machine nodes. One thing this needed underneath: a node with no `run` did not exist before. `read` learned `def` and `lookup`, and the node catalog test knows this third kind of node now, next to events and flow. Wiki: 84df59c, *State machines*.
admin moved this to Done in Development on 2026-09-15 06:21:33 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#57