Skip to manual
gluon

GOL language

Interface

An Interface lists the properties, links and actions that every implementing object type must provide.

Model author or developer

Where it goes

Contoso keeps Auditable in domains/core/interfaces.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 InterfaceSpec in the GOL JSON Schema.

FieldPresenceShape
extendsOptionalrefList
propertiesOptionalpropertyMap
linksOptionalarray
actionsOptionalarray
searchOptionalsearch

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.

7. Interface

GOL · YAML
kind: Interface
metadata: { name: Agreement, domain: core }
spec:
  extends: [core.Auditable]
  properties:
    startsOn: { type: date, required: true }
    endsOn: { type: date }
    renewalDate: { use: core.renewalDate }
  links: # link constraints every implementer must satisfy
    - { role: counterparty, to: party.LegalEntity, multiplicity: "1..*" }
  actions: [Renew] # action contracts implementers must bind
  search: { facets: [startsOn] }

An implementing ObjectType lists implements[].map for every interface property whose local name differs, implements[].links binding each interface link constraint to one of its own link roles, and implements[].actions binding each action contract to a concrete ActionType. A binding may be omitted only when the local name is identical. Missing mappings GLN-E221, type mismatch GLN-E222, unsatisfied link constraint GLN-E223. Interfaces can be link ends, policy resources, chat scopes and action parameter types.

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 Auditable Interface in the designer's YAML pane, with its validation status.
Contoso's Auditable Interface in the designer's YAML pane, with its validation status.