tinyactors path
Find the shortest path to a state: events, conditions and transitions.
Usage
tinyactors path [options] INPUT...Searches a chart's configurations breadth first for one holding the --to state. It starts from the initial configuration, or from the --from state. Any transition whose source is active may be taken: events come in any order and conditions may hold. So each step lists the events that take it and the condition it needs. The chart is the first one, or the one --chart names.
Options
-W, --warnings-as-errorsRefuse a chart that compiles with a warning.-I, --include DIRSearchDIRfor a src that is not beside the file naming it, in the order given. Repeatable.-c, --chart NAMELook at the chart namedNAMEonly. Repeatable.-s, --segment NRead the image that segment N of a snapshot runs. Default: the newest live segment.-t, --to STATESearch for a configuration that holdsSTATE.--from STATEStart inSTATE, entered with its defaults. Default: the initial configuration.-u, --unreachableSucceed only when no path exists, and exit with 1 otherwise.
Configure output formats like -f json using the shared options on the command reference.
Examples
tinyactors path order.scxml --to shipped# Path
- **Chart**: order
- **From**:
- **To**: shipped
- **Result**: found
- **Meaning**: the steps below reach it, if their events come and their conditions hold
- **Transitions**: 3
- **Explored**: 5
- **Start**: open
## Steps
| Step | Events | Eventless | Condition | Source | Targets | Active |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | checkout | no | total > 0 | open | paying | paying |
| 2 | charge.ok | no | | paying | paid | paid |
| 3 | shipped | no | | paid | shipped | shipped |Find the shortest path to shipped.
tinyactors path order.scxml --from cancelled --to paid --unreachable# Path
- **Chart**: order
- **From**: cancelled
- **To**: paid
- **Result**: unreachable
- **Meaning**: no sequence of transitions reaches it, whatever events come and conditions hold
- **Transitions**: 0
- **Explored**: 1
- **Start**: cancelled
## Steps
_none_Fail if paid can be reached from cancelled.
tinyactors path -f json --chart payment shop.tai --to settled{
"chart": "payment",
"from": "",
"to": "settled",
"result": "found",
"meaning": "the steps below reach it, if their events come and their conditions hold",
"transitions": 2,
"explored": 4,
"start": "pending",
"steps": [
{
"step": 1,
"events": "authorize",
"eventless": false,
"condition": "",
"source": "pending",
"targets": "authorized",
"active": "authorized"
},
{
"step": 2,
"events": "capture",
"eventless": false,
"condition": "",
"source": "authorized",
"targets": "settled",
"active": "settled"
}
]
}Find a path in one chart of an image as JSON.
Exit status
1An input is refused: it does not compile or verify, or it is damaged or of an unknown format.1Without--unreachable, no path exists or the search stops at its limit.1With--unreachable, a path exists, or the search stops at its limit.3A file cannot be read or written, or memory runs out.
Related pages
tinyactors statesList each chart's states as a tree in document order.tinyactors transitionsList each chart's transitions with events, conditions and targets.tinyactors eventsList every event name and the transitions, raises and sends using it.tinyactors dataList each chart's data declarations.tinyactors expressionsList each chart's expressions and scripts with where they are.tinyactors graphDraw each chart, or list its boxes and edges.tinyactors disassembleList each chart's executable content instruction by instruction.tinyactors inspectShow what an image, a snapshot or a blob holds.