Skip to manual
gluon

GOL language

ValueType

A ValueType is a scalar with its own checks and masking, such as an IBAN or a contract number.

Model author or developer

Where it goes

Contoso keeps Iban in domains/party/types.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 ValueTypeSpec in the GOL JSON Schema.

FieldPresenceShape
baseRequiredtypeExpr
constraintsOptionalconstraints
normalizeOptionalarray
checkOptionalcel
sensitivityOptionalsensitivity
examplesOptionalarray

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.

4.2 ValueType (DDD value object, scalar)

GOL · YAML
kind: ValueType
metadata: { name: Iban }
spec:
  base: string
  constraints: { pattern: "^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$", maxLength: 34 }
  normalize: [trim, upper, removeSpaces]
  check: gluon.iban.valid(self) # CEL, may call std functions
  sensitivity: { pii: financial, masking: { method: partial, keepLast: 4 } }
  examples: ["NL91ABNA0417164300"]

Constraints: minLength maxLength pattern format min max exclusiveMin exclusiveMax multipleOf precision scale oneOf minItems maxItems uniqueItems.

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