Commit 011a3ee
The sample was written against 2.0.0-preview.2, whose fluent builder
materialized no state or transition nodes and could not attach a sub state
machine to a state. preview.4 does both, so the two parts issue #829 deferred
can be built.
Server: the Operation machine now carries a Production sub state machine below
its Running state - Loading (initial), Processing and Unloading, with StartBatch
as a cause of the child and the rest of the batch on the child's own timers. The
framework activates and resets it when the parent enters Running and suspends it
when the parent leaves. The states, transitions, their numbers and the Part 16
references are materialized by the builder, so the server code only declares the
machine.
Client: the window lists the model of the machine - a row per state and per
transition with its number and NodeId - read through GetAvailableStatesAsync and
GetAvailableTransitionsAsync, finds the sub state machine with
GetSubStateMachineAsync on the state node it hangs off, and watches the Operation
machine through ObserveEffectiveStateAsync so a transition of the parent or of
the child is reported as one combined snapshot. The cause of the child is offered
only while the child is active, which is what its Executable attribute says.
Tests: the browse shape assertion covers the new children; new cases hold the
machine to AvailableStates / AvailableTransitions in declaration order with the
declared numbers, to the FromState / ToState / HasCause / HasEffect references of
a transition, to HasSubStateMachine hanging off the state node rather than the
machine root, to Bad_StateNotActive and BadNotExecutable while the child is
suspended, and to a batch running to completion and starting over on re-entry.
The tier 2 client case checks the model list, the cause becoming executable and
the displayed sub state.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 60d20fa commit 011a3ee
7 files changed
Lines changed: 1067 additions & 42 deletions
File tree
- Tests
- SampleClients.Tests
- SampleNodeManagers.Tests
- Workshop/StateMachines
- Client
- Server
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
368 | 418 | | |
369 | 419 | | |
370 | 420 | | |
| |||
0 commit comments