tok
v1.0.3Model BPMN processes and DMN decisions as text: check, export, import, simulate, evaluate.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
check Check a tok model
Check a tok document and list its diagnostics (code, severity, line, element, message), as `tok check --json`. Every layer is checked: tokens, statements, references, BPMN 2.0 rules, the Camunda 8 profile of executable documents, decisions, FEEL and simulation parameters. A document with errors is a successful call with errors > 0; fix the errors and check again. Codes are explained in the reference topic 'diagnostics'.
| Parameter | Type | Description |
|---|---|---|
bpmn | boolean | Also check the BPMN 2.0 rules of the exported model (E, W, L codes). |
class | string | BPMN 2.0.2 conformance class to check against; elements outside it are R075. |
lang | string | Language of diagnostics and reports. |
level | string | Teaching level: the elements the document may use (spec §13). |
path | string | Path of a .tok file, read by the server (relative to its working directory). Give either text or path. |
text | string | The tok document. Give either text or path. |
check_bpmn Check a BPMN file
Check BPMN 2.0 XML, from tok or from any modelling tool, with the BPMN rules of the tok checker, as `tok check FILE.bpmn --json`: every finding has a code, a severity, the line and the id of its element and a message. steps requires every element name to start with the step number of a process description (K01); description, the text of that description, reports steps without an element and elements without a step (K02, K03); camunda adds the Camunda 8 profile of executable models (C codes; with path, forms and decisions are looked for in the file's folder). XML with errors is a successful cal…
| Parameter | Type | Description |
|---|---|---|
camunda | boolean | Also check the Camunda 8 profile of executable models (C codes). |
description | string | The process description whose table lists the steps (its first column holds the step numbers); checks that every step is in the model (K02, K03). |
lang | string | Language of diagnostics and reports. |
path | string | Path of a .bpmn file, read by the server (relative to its working directory). Give either xml or path. |
steps | boolean | Element names start with step numbers (K01). |
xml | string | The BPMN 2.0 XML. Give either xml or path. |
fmt Format a tok model
Print a tok document in its canonical form, as `tok fmt`. The document must have no syntax errors. The result is the text only; write it to the file yourself.
| Parameter | Type | Description |
|---|---|---|
lang | string | Language of diagnostics and reports. |
path | string | Path of a .tok file, read by the server (relative to its working directory). Give either text or path. |
text | string | The tok document. Give either text or path. |
export Export a tok model
Export a checked tok document and return the contents of the files `tok export` writes: BPMN 2.0 XML with diagram layout (NAME.bpmn), its SVG picture (NAME.svg), DMN files of the decisions (with NAME.drd.svg pictures in languages 0.7 and 1.0) and Camunda form files (ID.form). With path, the layout sidecar FILE.tok.layout next to the file is used. A document with errors is a tool error listing them.
| Parameter | Type | Description |
|---|---|---|
formats | array | The kinds of file to return; all when left out. 'dmn' includes the decision diagrams (.drd.svg). |
lang | string | Language of diagnostics and reports. |
name | string | Stem of the BPMN and SVG file names; default: the stem of path, or 'model'. |
path | string | Path of a .tok file, read by the server (relative to its working directory). Give either text or path. |
sidecar | boolean | Use the layout sidecar FILE.tok.layout next to path. |
text | string | The tok document. Give either text or path. |
import Import BPMN or DMN
Convert a BPMN 2.0 XML or DMN 1.1–1.5 file to a tok document, as `tok import`. Elements tok does not keep are listed in warnings. For BPMN the diagram of the file is returned as a layout sidecar: save it as FILE.tok.layout next to the document to keep the drawing.
| Parameter | Type | Description |
|---|---|---|
flow_ids | boolean | Keep the identifiers of sequence flows (false prints compact chains). |
format | string | |
layout | boolean | Return the layout sidecar of a BPMN file. |
path | string | Path of a .bpmn or .dmn file, read by the server. Give either xml or path. |
xml | string | The BPMN or DMN XML. Give either xml or path. |
sim Simulate a tok model
Run the discrete-event simulation of a tok document, as `tok sim`: indicators (cases per end event, cycle times, waiting and processing times, resource utilization) and the report text. The same seed gives the same run. The event log and the case table are large; ask for them only when needed.
| Parameter | Type | Description |
|---|---|---|
cases | integer | Number of cases; overrides `simulate cases=`. |
cases_table | boolean | Include one object per case. |
csv | boolean | Include the event log and the case table as CSV text. |
lang | string | Language of diagnostics and reports. |
log | boolean | Include the event log (one object per activity instance). |
path | string | Path of a .tok file, read by the server (relative to its working directory). Give either text or path. |
seed | integer | Random seed; overrides `simulate seed=`. |
text | string | The tok document. Give either text or path. |
xes | boolean | Include the event log as XES. |
eval Evaluate a decision
Evaluate a decision of a tok document for input values, as `tok eval`. In languages 0.7 and 1.0 the decision is evaluated with everything it requires and values are given by the FEEL names of input data; in earlier languages the decision table alone is evaluated over its input columns. Values are JSON (numbers, text, booleans, null, lists, objects as contexts).
| Parameter | Type | Description |
|---|---|---|
decision * | string | Identifier of the decision. |
lang | string | Language of diagnostics and reports. |
path | string | Path of a .tok file, read by the server (relative to its working directory). Give either text or path. |
text | string | The tok document. Give either text or path. |
values | object | Input name → value. |
reference tok language reference
The reference documentation of the tok language: 'cheatsheet' (the whole language on one page; read it before writing a model), 'spec' (the normative specification), 'diagnostics' (every diagnostic code), 'feel' (expressions), 'cli' (the tok command). The same texts are resources tok://reference/TOPIC.
| Parameter | Type | Description |
|---|---|---|
topic | string |