TokLang.jl

tok is a plain-text language for BPMN 2.0 process models and DMN decisions. TokLang.jl is its Julia package. These pages are the reference of its public API. The guide to the package explains how the parts work together, and the guide to tok teaches the language.

using Pkg
Pkg.add("TokLang")
ModuleWhat it doesReference
TokLangthe independent core: parser, canonical printer, semantic BPMN exportIndependent core
TokLang.Enginethe whole language through the Rust engineEngine
TokLang.Simthe native simulator for large experimentsNative simulation
TokLang.Fitcalibration of simulation parameters on event logsCalibration

The folder examples of the package holds runnable scripts, one for each module; pkgdir(TokLang, "examples") gives its path.

The engine library

The engine comes with the package: tok_jll is a dependency of TokLang.jl and holds the prebuilt library for Linux (x8664 and aarch64, glibc and musl), macOS (x8664 and Apple silicon) and Windows (x86_64). On any other platform TokLang.Engine.available returns false. The independent core works, and the functions of Engine, Sim and Fit raise an error that says so.

To use your own build of the engine, for example when you work on the engine itself, build it with cargo build --release -p tok-capi in the folder rust of the repository and override the library of tok_jll:

using Pkg
Pkg.add("Preferences")
using Preferences, tok_jll
set_preferences!(tok_jll, "libtokengine_path" => "/path/to/libtokengine.so"; force=true)

The setting is written to LocalPreferences.toml of the active project and takes effect when Julia restarts. The library must implement the version of the C interface that TokLang.jl is written for (TokLang.Engine.abi_version).