Xtate.DataModel.EcmaScript adds an ECMAScript data-model handler to Xtate.Core. It uses Jint to evaluate SCXML expressions and executable content identified by datamodel="ecmascript".
- Evaluates value, condition, location, script, and external-script expressions.
- Supports SCXML
foreach, inline content, external data, and custom actions. - Converts between Jint values and Xtate
DataModelValue/DataModelListvalues. - Exposes the active Jint version through the data-model variables.
- Registers as a scoped Xtate data-model handler through
Xtate.IoC.
dotnet add package Xtate.DataModel.EcmaScriptRegister the ECMAScript handler alongside the Xtate modules used by the application:
using Xtate.DataModel.EcmaScript.DependencyInjection;
using Xtate.IoC;
var services = new ServiceCollection();
services.AddModule<EcmaScriptDataModelHandlerModule>();An SCXML document can then select the handler with datamodel="ecmascript":
<scxml xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
datamodel="ecmascript"
initial="done">
<datamodel>
<data id="message" expr="'Hello from ECMAScript'" />
</datamodel>
<final id="done" />
</scxml>The library targets .NET 11, .NET 10, .NET 9, .NET 8, .NET Standard 2.0, and .NET Framework 4.6.2.
git clone https://github.com/TSSArt/Xtate.DataModel.EcmaScript.git
cd Xtate.DataModel.EcmaScript
dotnet restore
dotnet build Xtate.DataModel.EcmaScript.sln
dotnet test Xtate.DataModel.EcmaScript.sln| Path | Description |
|---|---|
src/Xtate.DataModel.EcmaScript |
Handler, engine, evaluators, wrappers, and resources |
test/Xtate.DataModel.EcmaScript.Test |
MSTest behavior and integration tests |
.github/instructions |
Path-specific guidance for coding agents |
.github/workflows |
Security analysis and publishing workflows |
.agents |
Repository guide for maintainers and coding agents |
Contributions are welcome. Read the repository guide, follow .editorconfig, and add focused tests for expression, conversion, or execution behavior changes.
Use GitHub Issues for bug reports and feature requests.
Xtate.DataModel.EcmaScript is licensed under the GNU Affero General Public License v3.0 or later.