Skip to content
Leon Starr edited this page Jul 24, 2026 · 2 revisions

After any metadata, the first thing an xsm file must declare is the domain that owns the state model.

domain Elevator Management

The grammar is:

domain_header = "domain" SP name EOL*

So we have the keyword domain, exactly one space, and then the domain name.

Note that this is looser than the corresponding line in the xcm class model language, which requires an all caps alias after a comma. Here there is no alias — just the full domain name. The name must match the domain name declared in that domain's class model, since the state model's events, classes and relationships are all resolved against it.

Unlike a class model, a state model is not scoped to a subsystem. There is no subsystem line. A state model belongs to the domain, and the class or relationship it describes is found wherever it happens to be defined within that domain.

The next line declares whether this is a lifecycle or an assigner. See Lifecycle vs Assigner.

Clone this wiki locally