Skip to content

Read a validation result

When a workflow's configuration violates a validation rule, the platform produces a structured validation result set — a list of rule results, each with one or more failing cases. This how-to covers what's in it, how to read it from the SimKit Web UI and the CLI, and what to do with the structured details field.

Prerequisites

  • A workflow that has at least one validation rule defined on its workflow type or method dependency.
  • A configuration that violates one of those rules.

Where validation runs

Interactive validation (validationRuleSet) runs at configuration write time — when the user saves a configuration in Workbench, or when simkit run start parses the configuration before submitting the run. A failing rule blocks the run from starting at all.

Non-interactive validation (nonInteractiveValidationRuleSet) runs in the workflow runner once the run is started, while the run is in the VALIDATING state. Its result set has the same shape and is read from the run rather than from the workflow version:

simkit run validation <run-id>          # human-readable summary
simkit run validation <run-id> --json   # the WorkflowRunValidation payload

The payload carries the validation state (SKIPPED when the workflow type has no non-interactive rules, PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED), the validationResultSet once the rules were evaluated, and an error when the rules could not be executed at all (an unavailable service, or the validation exceeding the runner's time limit). A FAILED validation fails the run with the error code workflow-runner-run-validation-failed; the run's own error summarizes the failing cases.

What a validation result contains

ValidationResultSet
  └─ ValidationResult[]
       ├─ rule code, name, description (echoed from the rule definition)
       ├─ valueReference                       // which field (indexed for a list element: /presets/2)
       ├─ elementReference                     // list element's stable id, when the rule ran per element
       └─ ValidationResultCase[]               // only the failing cases
            ├─ case code
            ├─ severityLevel (ERROR | WARNING)
            ├─ message       (resolved value model — e.g. "Edge length too small: 0.5 mm")
            ├─ multiLanguageMessage (per-locale messages)
            └─ details       (structured payload, optional)

Only failing cases appear; passing cases are silent.

If the value at the rule's valueReference is missing or has the wrong type, the rule produces a synthetic case (ValidationErrors.missingValue / invalidDataType) instead of running its own cases.

A per-element rule (eachElement) produces one result per failing element: valueReference is the element's indexed path (/presets/2) and elementReference carries the list path plus the element's stable id when the element has one ({ "listPath": "/presets", "elementId": "9f3a…" }), so a UI can jump to the exact row. Aggregate list rules (unique, monotonic, …) stay at the list and list the offending element indices under details.offendingElementIndices, as a typed detail ({ "type": "list", "value": [1, 2] }).

In the SimKit Web UI

Failing cases appear inline on the configuration form, anchored to the field they target (the rule's valueReference). ERROR cases block the save / run-start; WARNING cases warn but allow.

The SimKit Web UI groups multiple failing cases of the same rule together; severity is colour-coded (red for ERROR, yellow for WARNING).

From the CLI

simkit workflow validate reports validation results for a workflow's current configuration without starting a run:

simkit workflow validate <workflow-id>

Returns the rule results in JSON or a human-readable form depending on the flags. Useful for CI gates: a script can parse the JSON, fail on any ERROR, surface WARNINGs as build warnings.

What's in details

Each failing case can carry a details: Map<String, Value> — arbitrary structured data that the rule author attached. Example:

ValidationRuleCase(
    code = "edge_too_small",
    condition = configValueModel.edgeLength greaterThan 1.millimeter,
    severityLevel = SeverityLevel.ERROR,
    message = "Too small: ".asValueModel() + configValueModel.edgeLength,
    details = mapOf(
        "actual" to configValueModel.edgeLength,
        "minimum" to 1.millimeter.asValueModel(),
    ),
)

When the rule fires, the details map is resolved against user data (so actual becomes whatever the user typed) and shipped alongside the message. Downstream consumers — a UI showing a "clamp to minimum?" suggestion, or a CI script collating violations — read the structured form without parsing the message.

The textual message is for humans; details is for tools.

Severity rules of thumb

  • ERROR — the workflow physically cannot run with this configuration; e.g. a divide-by-zero, a missing required reference, a value out of the method's hard support range.
  • WARNING — the workflow can run but the result is likely poor or unexpected; e.g. an unusually small mesh size that will take a long time, an iteration count below the typical convergence range.

If you find yourself wanting "INFO," it's typically a doc(...) note on the field, not a validation rule. The platform doesn't have an INFO severity.

Cross-references