Crates.io | scjson |
lib.rs | scjson |
version | 0.3.2 |
created_at | 2025-07-22 03:50:04.967259+00 |
updated_at | 2025-07-30 01:31:07.973077+00 |
description | SCXML to JSON converter, part of the multi-language scjson ecosystem |
homepage | https://github.com/softoboros/scjson |
repository | https://github.com/softoboros/scjson |
max_upload_size | |
id | 1762950 |
size | 101,798 |
This directory contains the Rust implementation of scjson. It offers a command line tool and supporting library to convert between .scxml
and .scjson
files and to validate documents.
For details on how SCXML elements are inferred during conversion see INFERENCE.md.
cargo install scjson
You can also build from this repository:
cd rust && cargo build --release
[https://github.com/SoftOboros/scjson/]
scjson json path/to/machine.scxml
scjson xml path/to/machine.scjson
scjson validate path/to/dir -r
None at this time.
Operational conformance testing is performed via uber_test.py
/py# python uber_test.py -l javascript 2>&1 | tee test.log
Note: uber_test.py applies all scxml files in Zhornyak's ScxmlEditor-Tutorial which provides a robest set of scxml test vectors useful for standard compliance verification. This is the only file in the test suite which fails to verify round-trip.
Each enumeration represents a restricted string set used by SCXML. The values shown below mirror those defined in the SCJSON schema.
AssignTypeDatatypeProps
– how the <assign>
element manipulates the datamodel.
Values: replacechildren
, firstchild
, lastchild
, previoussibling
,
nextsibling
, replace
, delete
, addattribute
.BindingDatatypeProps
– determines if datamodel variables are bound early
or
late
during execution.BooleanDatatypeProps
– boolean attribute values true
or false
.ExmodeDatatypeProps
– processor execution mode, either lax
or strict
.HistoryTypeDatatypeProps
– type of <history>
state: shallow
or deep
.TransitionTypeDatatypeProps
– whether a <transition>
is internal
or
external
.Several generated classes share generic helper fields:
other_attributes
: Record<str, str>
capturing additional XML attributes from
foreign namespaces.
other_element
: list[object]
allowing untyped child nodes from other
namespaces to be preserved.
content
: list[object]
used when elements permit mixed or wildcard
content.
AssignProps
AssignArray
– update a datamodel location with an expression or value.
CancelProps
CancelArray
– cancel a pending <send>
operation.
ContentProps
ContentArray
– inline payload used by <send>
and <invoke>
.
DataProps
DataArray
– represents a single datamodel variable.
DatamodelProps
DatamodelArray
– container for one or more <data>
elements.
DonedataProps
DonedataArray
– payload returned when a <final>
state is reached.
ElseProps
– fallback branch for <if>
conditions.
ElseifProps
– conditional branch following an <if>
.
FinalProps
FinalArray
– marks a terminal state in the machine.
FinalizeProps
FinalizeArray
– executed after an <invoke>
completes.
ForeachProps
ForeachArray
– iterate over items within executable content.
HistoryProps
HistoryArray
– pseudostate remembering previous active children.
IfProps
IfArray
– conditional execution block.
InitialProps
InitialArray
– starting state within a compound state.
InvokeProps
InvokeArray
– run an external process or machine.
LogProps
LogArray
– diagnostic output statement.
OnentryProps
OnentryArray
– actions performed when entering a state.
OnexitProps
OnexitArray
– actions performed when leaving a state.
ParallelProps
ParallelArray
– coordinates concurrent regions.
ParamProps
ParamArray
– parameter passed to <invoke>
or <send>
.
RaiseProps
RaiseArray
– raise an internal event.
ScriptProps
ScriptArray
– inline executable script.
ScxmlProps
– root element of an SCJSON document.
SendProps
SendArray
– dispatch an external event.
StateProps
StateArray
– basic state node.
TransitionProps
TransitionArray
– edge between states triggered by events.
github: [https://github.com/SoftOboros/scjson]
git clone https://github.com/SoftOboros/scjson.git
git clone git@github.com:SoftOboros/scjson.git
gh repo clone SoftOboros/scjson
npm: [https://www.npmjs.com/package/scjson]
npm install scjson
pypi: [https://pypi.org/project/scjson/]
pip install scjson
dockerhub: [https://hub.docker.com/r/iraa/scjson] (Full development environment for all supported languages)
docker pull iraa/scjson:latest
All source code in this directory is released under the BSD\u00A01-Clause license. See LICENSE and LEGAL.md for details.