Skip to manual
gluon

GOL language

EventType

An EventType gives a domain event its payload, the actions that emit it and how long it is kept.

Model author or developer

Where it goes

Contoso keeps ContractRenewed in domains/procurement/behaviour.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in PascalCase. The name must be unique within its domain across all type kinds.

Fields

The keys under spec. Nested shapes follow EventTypeSpec in the GOL JSON Schema.

FieldPresenceShape
payloadRequiredpropertyMap
emittedByOptionalrefList
retentionOptionalduration
subscribersOptionalrefList

Syntax and rules

The examples are fragments. Put them in a package next to the resources they reference. A ... stands for a CEL expression you write yourself.

9.2 EventType (domain event)

GOL · YAML
kind: EventType
metadata: { name: ContractRenewed }
spec:
  payload: { contractId: uuid, previousExpiry: date, newExpiry: date }
  emittedBy: [RenewContract]
  retention: P10Y
  subscribers: [finance.AccrualRecalculation] # informational, drives the context map view

Check your package

Shell
gluon validate examples/contoso
gluon test examples/contoso

validate reports each problem with a GLN code and its place in the file. test runs the package's Test resources. See the language guide and the diagnostics.

Contoso's ContractRenewed EventType in the designer's YAML pane, with its validation status.
Contoso's ContractRenewed EventType in the designer's YAML pane, with its validation status.