Event Modeling in HCL
Keep an Event Model in git, validate it, and render it to HTML.
.em.hcl is an HCL-based language for Event Modeling.
A small example
What the tool does
Validate
Checks references, workflow rules, scenarios, and model structure.
Format
Keeps .em.hcl files consistent.
Render
Produces a self-contained HTML Event Model.
Why it was created
There was a need for Event Models that could live beside the code, survive code review, and be checked by tooling. HCL happened to fit the shape quite nicely.
The validated typed model can also feed documentation or coding-agent workflows.
Examples
Each diagram is generated from the .em.hcl source in the repository.
Why HCL?
It allows an Event to be an event block rather than an object with kind: event. HCL also provides traversal expressions that the .em.hcl validator can check as references.
The downside is more custom tooling. YAML is easier to adopt, and JSON has a broader interchange ecosystem. For this project, HCL gives a good tradeoff.
About this project
This project builds on Event Modeling and work by Adam Dymitruk, Martin Dilger, EmLang, ESDM, and others in the Event Modeling community.
.em.hcl is not a new Event Modeling method. It is one textual representation plus a validator, formatter, and renderer.
Project status
Status: experimental
Current spec: v0.3.0
CLI: v0.4.0
Syntax may still change before 1.0.
Try the example
Install the CLI, validate a small model, and open the generated diagram.