Reference for .em.hcl v0.3.0

The cheat sheet

Blocks, attributes, values, and commands in one page. The normative specification remains authoritative.

Top-level blocks

BlockCategoryPurpose
bounded_contextCatalogOwns aggregates, field types, and Events
actorCatalogA reusable human or system actor
teamCatalogA reusable owning team
systemCatalogA reusable external or internal system
state_changeWorkflowScreen/API → Command → Event
state_viewWorkflowEvent → Read Model → Screen
automationWorkflowInternal Event → Processor → Command → Event
translationWorkflowExternal Event → Processor → Command → internal Event
chapterWorkshop notationGroups a contiguous range of workflows
hotspotWorkshop notationAn unresolved question or blocker

Inside a bounded_context

BlockPurpose
aggregateA context-owned consistency boundary
field_typeA reusable, ubiquitous-language field definition
eventA canonical past-tense fact, with field children

Inside a workflow

BlockUsed byPurpose
screenState Change, State ViewA human-facing interaction surface
screen_imageAny workflowA presentation-only rough wireframe or mockup with a url
commandState Change, Automation, TranslationAn intent that can succeed or fail; needs a reason (to-flow, api_endpoint, or external_trigger)
readmodelState View, Automation, TranslationRequires question
processorAutomation, TranslationThe "gear" — a machine reaction
tableAny workflowPresentation-only illustrative tabular or example data
scenarioAny workflowPattern-specific Given/When/Then — see below

Scenario grammar

WorkflowGivenWhenThen
State ChangeEvent, zero or moreone CommandEvent or Error, one or more
State ViewEvent, one or morenoneRead Model or Error, one or more
Automation / TranslationEvent or Read Modelone Processor or CommandEvent or Error, one or more

Reference forms

TargetForm
Bounded contextbounded_context.clinic
Actor / Team / Systemactor.clinic_staff / team.clinic_team / system.partner
Workflowworkflow.add_pet
Eventevent.pet_management.pet_added
Aggregateaggregate.pet_management.pet (or aggregate.pet inside its own context)
Field typefield_type.pet_management.pet_id (or field_type.pet_id inside its own context)
Local workflow elementcommand.add_pet
Workflow-qualified element (for a hotspot)command.add_pet.add_pet_command

Field types and flags

Built-in types: String, Boolean, Double, Decimal, Long, Custom, Date, DateTime, UUID, Int.

A field may omit type when a same-named field_type can be inferred. Use fields = [field_type.context.name] to add several reusable fields without per-field overrides. A field_type always declares its built-in type.

AttributeMeaning
id_attribute = trueThis field identifies the record
optional = trueThe field may be absent (fields are required by default)
pii = truePersonally identifiable information
cardinality = "List"The field is list-valued
example = ...A native HCL literal, checked against the effective type

Workflow status values

created, planned, assigned, in_progress, review, blocked, done, informational.

Validation profiles

ProfileJudgment diagnostics (EM404, EM406, the four smells)
workshopInformational
valid (default)Warnings
strictEM404 / EM406 become errors; the four smells stay non-blocking

Diagnostic families

PrefixCategory
EM0xxStructural
EM1xxReferences
EM2xxFlow
EM3xxScenarios
EM4xxModeling judgment

Diagnostics print as file:line:column: Severity EMxxx: message.

CLI commands

CommandDoes
eventmodeling-hcl validate <model.em.hcl>Validates with the default valid profile
eventmodeling-hcl validate --profile <workshop|valid|strict> <model.em.hcl>Validates with an explicit profile
eventmodeling-hcl diagram <model.em.hcl> -o <file>Renders a self-contained interactive HTML canvas (or writes to stdout without -o)
eventmodeling-hcl fmt -w <model.em.hcl>Canonicalizes whitespace and attribute order in place
eventmodeling-hcl versionPrints the installed version