Reference: unified DSL¶
The four .kts formats authors write — top-level blocks per kind,
required vs optional, what each block holds, what symbols are in
scope inside each block.
For the underlying schema description language used inside
dataSchema { }, metadataSchema { }, and configurationSchema { },
see schema-dsl.md. For the operations available
inside workflowDefinition { }, see
workflow-definition-operations.md.
.data-type.kts¶
Outer block: dataType { }.
dataType {
dependencies { /* dataType / method / workflowType dependencies */ }
metadata {
reference = "group:id:version"
name = "…"
description = "…" // Markdown allowed
// releaseNotes = "…" // optional, what changed in this version; Markdown allowed
// documentation { … } // optional, Markdown documentation pages; see "Documentation block" below
// categories("…") // optional, category identifiers the registry defines for this component type
// tags("…", "…") // optional, tag identifiers the registry defines for this component type
// roles = setOf(SCHEMA) // DATA (default: workflow data) | SCHEMA (a reusable fragment only) | MATERIAL (material schema)
}
dataSchema { /* required, can be empty */ }
// Optional:
// metadataSchema { … }
// uiSchema { … }
// dataSchemaValidationRuleSet { /* return ValidationRuleSet */ }
// metadataSchemaValidationRuleSet { /* return ValidationRuleSet */ }
// migrationRoutes { from("1.0.0") }
// migrationRuleSet { /* return MigrationRuleSet */ }
}
| Block | Required | Receiver / scope |
|---|---|---|
dependencies |
yes (can be empty) | dependency declaration functions: dataType(...), method(...), workflowType(...) |
metadata |
yes | DataTypeMetadataBuilder — reference, name, description, releaseNotes, multiLanguageName, multiLanguageDescription, iconName, documentation { }, roles (set of DataTypeRole: DATA by default, SCHEMA, MATERIAL; see the roles of a data type), uploadable, downloadable, fileFormatGroup(...) |
dataSchema |
yes (can be empty) | SchemaDefinition receiver — see schema-dsl.md |
metadataSchema |
no | SchemaDefinition receiver |
uiSchema |
no | SchemaDefinition receiver |
dataSchemaValidationRuleSet |
no | rule(…) { cases } declarations — see validation helpers; a plain ValidationRuleSet expression also works; valueModel in scope |
metadataSchemaValidationRuleSet |
no | rule(…) { cases } declarations; a plain ValidationRuleSet expression also works; metadataValueModel in scope |
migrationRoutes |
no | MigrationRouteDefinition — from(...) declarations |
migrationRuleSet |
no | block returns MigrationRuleSet; generated migrationFrom<version> { } adapters in scope (oldMetadata / newMetadata) |
A migrationRoutes { from(...) } source is not declared in
dependencies { } — it is resolved on its own at build time, and the registry
records it as a migration source rather than a runtime dependency. Routes are
declared across major versions only; within one major, data migrates
implicitly. Data type migration rules transform only the domain-specific
metadata; the stored content is carried over unchanged. See
Migration.
Build output: a single <ref>.data-type.json file.
.method.kts¶
Outer block: method { }.
method {
dependencies { /* dependencies */ }
metadata {
reference = "group:id:version"
name = "…"
description = "…" // Markdown allowed
// releaseNotes = "…" // optional, what changed in this version; Markdown allowed
// documentation { … } // optional, Markdown documentation pages; see "Documentation block" below
// categories("…") // optional, category identifiers the registry defines for this component type
// tags("…", "…") // optional, tag identifiers the registry defines for this component type
}
dataInterface {
// input("…", "data-type:ref:1.0.0") { label("…") }
// output("…", "data-type:ref:1.0.0") { label("…") }
}
configurationSchema { /* SchemaDefinition body */ }
executable {
imageName = "…"
imageTag = "latest"
executableName = "…"
}
codeGeneration {
language = "none" // "python" | "go" | "rust" | "kotlin" | "none"
// Optional — where generated sources land, relative to this script
// (default: next to the script):
// outputDirectory = "build/generated/simkit/python"
}
// Optional:
// validationRuleSet { /* return ValidationRuleSet */ }
// uiConfiguration { /* return UiConfiguration */ }
// resourceEstimation { /* return MethodResourceEstimationValueModel */ }
}
| Block | Required | Receiver / scope |
|---|---|---|
dependencies |
yes (can be empty) | dependency functions |
metadata |
yes | MethodMetadataBuilder — reference, name, description, releaseNotes, multiLanguageName, multiLanguageDescription, iconName, categories(...), tags(...), documentation { } |
dataInterface |
yes (can be empty) | MethodDataInterface — input(...), output(...) |
configurationSchema |
yes (can be empty) | SchemaDefinition |
executable |
yes | ExecutableMetadata — imageName, imageTag, executableName |
codeGeneration |
yes | language — one of "python", "go", "rust", "kotlin", "none"; optional outputDirectory — relative to the script, must stay inside the component directory |
validationRuleSet |
no | rule(…) { cases } declarations — see validation helpers; a plain ValidationRuleSet expression also works; configValueModel in scope |
uiConfiguration |
no | block returns UiConfiguration — see UI configuration entries; configValueModel in scope. Method configurations are presented, not edited, so use the presentation entries |
resourceEstimation |
no | block returns MethodResourceEstimationValueModel; configValueModel in scope |
Build output: a single <ref>.method.json file.
A method's component directory may also hold native-side artifacts
(Dockerfile, sources, pyproject.toml) — simkit ignores them.
executable.imageName points at a pre-built image elsewhere.
.workflow-type.kts¶
Outer block: workflowType { }. Includes the dataflow graph inline.
workflowType {
dependencies { /* dependencies */ }
metadata {
reference = "group:id:version"
name = "…"
description = "…" // Markdown allowed
// releaseNotes = "…" // optional, what changed in this version; Markdown allowed
// documentation { … } // optional, Markdown documentation pages; see "Documentation block" below
// categories("…") // optional, category identifiers the registry defines for this component type
// tags("…", "…") // optional, tag identifiers the registry defines for this component type
}
dataInterface {
// input("…", "data-type:ref:1.0.0") { label("…") }
// output("…", "data-type:ref:1.0.0") { label("…") }
}
configurationSchema { /* SchemaDefinition body */ }
workflowDefinition {
// operations — see workflow-definition-operations.md
}
// Optional:
// migrationRoutes { … }
// analysisStrategy { WorkflowDefinitionAnalysisStrategy.DYNAMIC }
// uiConfiguration { /* return UiConfiguration */ }
// validationRuleSet { /* return ValidationRuleSet */ }
// nonInteractiveValidationRuleSet { /* return ValidationRuleSet */ }
// migrationRuleSet { /* return MigrationRuleSet */ }
}
| Block | Required | Receiver / scope |
|---|---|---|
dependencies |
yes (can be empty) | dependency functions |
metadata |
yes | WorkflowTypeMetadataBuilder — reference, name, description, releaseNotes, multiLanguageName, multiLanguageDescription, iconName, bannerName, categories(...), tags(...), documentation { } |
dataInterface |
yes (can be empty) | WorkflowTypeDataInterface |
configurationSchema |
yes (can be empty) | SchemaDefinition |
workflowDefinition |
yes | WorkflowDefinitionBuilder — configValueModel, data-interface symbols, generated method/nested-workflow call functions |
migrationRoutes |
no | MigrationRouteDefinition — from(...) declarations |
analysisStrategy |
no | block returns WorkflowDefinitionAnalysisStrategy.STATIC (default) or DYNAMIC |
uiConfiguration |
no | block returns UiConfiguration |
validationRuleSet |
no | rule(…) { cases } declarations — see validation helpers; a plain ValidationRuleSet expression also works; configValueModel in scope. Evaluated interactively by the workflow repository |
nonInteractiveValidationRuleSet |
no | same scope as validationRuleSet; evaluated by the workflow runner in the VALIDATING state of a started run, for expensive rules — see validation rules |
migrationRuleSet |
no | block returns MigrationRuleSet; receives source-version configValueModels |
Inside dataInterface, each input(...) block can additionally declare
validationRuleSet { … } over the metadata of the data assigned to that
input — the same rule(…) { cases } declarations as the configuration block
(a plain ValidationRuleSet expression also works). The input's data type
generates a typed metadata value model property for the block
(geometryMetadata, rooted at the input's own name), so rules anchor on
geometryMetadata.… directly — see
concepts: validation rules.
An input(...) block can also declare fixedData("data:<uuid>") to fix the
input to one specific data owned by the workflow type itself (for example
trained model weights); workflows then neither provide nor override it — see
concepts: workflow types.
Build output: a single <ref>.workflow-type.json file.
.material.kts¶
Outer block: material { }.
material {
metadata {
reference = "simscale.materials.library.fluids:water:1.0.0"
name = "Water"
description = "Liquid water at 20 °C, 1 atm."
// releaseNotes = "…"
// documentation { … } // optional, Markdown documentation pages; see "Documentation block" below
// customMetadata("source", "…") // free-form provenance
}
schema("simscale.materials.schemas:fluid:1.0.0") // the material schema with its version: the only dependency
properties { // assigned in the schema's generated data model builder
name = "Water"
fluidType = FluidType.LIQUID
density = 997.33.kilogram_per_cubic_meter
equationOfState { incompressible() } // polymorphic compound: the variant's function
electromagnetic { relativeElectricPermittivity = 80.1 } // nested compound: its own block
viscosityTemperatureDependence { // a table-valued property: one block call per row
table {
viscosityPoints { temperature = 273.15.kelvin; dynamicViscosity = 0.001792.pascal_second }
viscosityPoints { temperature = 293.15.kelvin; dynamicViscosity = 0.001002.pascal_second }
interpolation = TableInterpolation.LOGARITHMIC // the schema's generated enum constants
extrapolationAbove = TableExtrapolation.NONE // not to be read beyond the last row
}
}
// fields with schema defaults may be left out
}
// or, untyped: propertiesJson(""" { "name": "Water", "density": { "value": 997.33, "unit": "kg/m³" } } """)
}
| Block | Required | Receiver / scope |
|---|---|---|
dependencies |
no | optional: a material's only dependency is its schema, which schema(...) declares; the block is accepted for a version-less schema("group:id") |
metadata |
yes | MaterialMetadataBuilder — reference, name, description, releaseNotes, multiLanguageName, multiLanguageDescription, iconName, documentation { }, customMetadata(key, value) |
schema("group:id:version") |
yes | the data type the properties conform to, with the version to depend on (a pinned version, -SNAPSHOT-latest, …); the build records it as the material's dependency. schema("group:id") without a version is accepted when dependencies { } declares the schema |
properties |
one of the two | the schema's generated data model builder (<Schema>DataModelBuilder scope): assign plain Kotlin values — strings, numbers, the generated enum constants, dimensionals in the unit written (997.33.kilogram_per_cubic_meter); a nested compound is a block named after it (electromagnetic { … }), a polymorphic compound a function per variant (equationOfState { perfectGas { … } }), a compound list one block call per element; fields with schema defaults are preset and may be left out, a mandatory one left unset fails the build by name |
propertiesJson("…") |
one of the two | a JSON document in the schema's shape, as stored; for generated or migrated materials (simkit component generate-dsl renders this form). Nothing checks it at build time — a misspelled property surfaces when the registry validates the document at registration |
properties { } is evaluated out-of-band like the rule-set blocks: the body is compiled against the
schema's generated data model builder and the built document serialized at build time, with dimensionals
kept in the units written. The registry validates the document against the schema (structure,
defaults, rule sets) at registration.
Build output: a single <ref>.material.json file.
Documentation block¶
Inside any kind's metadata { } block, optional:
documentation {
page("introduction") { // kebab-case id, unique within the documentation
title = "Introduction" // required
title(Locale.GERMAN, "Einführung") // optional, per language
contentFile = "docs/introduction.md" // Markdown file relative to the component directory …
// content = "…" // … or inline Markdown; exactly one of the two per language
contentFile(Locale.GERMAN, "docs/de/einfuehrung.md")
page("details") { … } // nested pages form the table of contents
}
}
| Element | Required | Semantics |
|---|---|---|
page(id) { } |
at least one | one page of the table of contents; nested page calls are its sections |
title / title(locale, …) |
yes / no | the page title shown in the table of contents and above the content |
content / contentFile |
one of the two | inline Markdown, or a Markdown file relative to the component directory |
content(locale, …) / contentFile(locale, …) |
no | the same per language; a language without content falls back to the default |
Relative image references in the pages are resolved relative to the
Markdown file (the component directory for inline content), validated
(PNG, JPEG, GIF, WebP, SVG) and included in the component; relative
links to other pages' Markdown files become page:<id> links. See
Document a component.
Dependency declarations¶
Inside any dependencies { } block:
dataType("group:id:1.0.0") // released
method("group:id:1.0.0-SNAPSHOT-latest") // latest snapshot of the base version
workflowType("group:id:1.0.0-SNAPSHOT-2026-05-15-1") // an exact, pinned snapshot
The version qualifier in the reference decides what resolves. A bare
version (group:id:1.0.0) resolves the released component only. To
depend on a snapshot, add the qualifier to the reference:
-SNAPSHOT-latest floats to the newest snapshot of that base version,
or pin an exact snapshot such as -SNAPSHOT-2026-05-15-1.
A migrationRoutes { from(...) } source is not declared here. The
migration routes name older versions of this same workflow type; the build
resolves those versions automatically to generate the migration adapters, and
the registry records them as migration sources rather than runtime
dependencies. dependencies { } lists only the components used at runtime —
the data types, methods, and nested workflow types the workflow definition
actually calls.
Dependency-injected DSL surface¶
When a component depends on another component, that other component's surface is auto-generated and made available unqualified in the relevant blocks:
- Data type dependency — generates schema-DSL functions
(
mockMesh(name) { … },mockMeshList(name) { … }), value-model classes (MockMeshValueModel.fromDefaults { … }), and (for dimensional types) Number-extension literals (Number.millimeteretc.). - Method dependency — generates a method-call function in
workflowDefinition { }matching the method's name in camelCase (nativeTest(...)). - Workflow type dependency — generates a nested-workflow-call
function (
testInlineOperations(...)).
The package builder injects import <group>.* before compiling
your .kts, so the generated symbols appear unqualified.
Utility sources¶
Any .kt file beside or below a component script is part of the component:
it compiles into the build and its declarations are usable in every DSL
block and in the component's test scripts. Use utility sources to name and
share logic — an estimation formula, a family of validation rules — instead
of growing one large block.
mock-mesher/
├── mock_mesher.method.kts # blocks call into the helper
└── meshing_estimates.kt # helpers — no package needed
- A
packagedeclaration is optional — package-less files are placed in a shared synthetic package at build time. Declared packages are kept, and either way the package is star-imported into the script automatically (explicit imports also work). - Hidden directories,
build/directories, and the method'scodeGeneration.outputDirectoryare excluded from discovery. - Utilities compile before the component's own value models are generated,
so helpers take framework-typed parameters (
RealValue,ValueList<*>, dep-generated types, …) and the typedconfigValueModelaccess stays in the DSL blocks.dependencies { }cannot call utility code.
Test scripts¶
Component behaviors are testable without any services — see
Component tests. A test script lives next to its
component (<name>.method.test.kts, <name>.data-type.test.kts,
<name>.workflow-type.test.kts) and runs via simkit component test.