Skip to content

v5.0.0 Migration Guide — deprecated rule aliases removed

The rename shipped as a non-breaking change in 4.1.0 — the old names were kept as @Deprecated typealiases. v5.0.0 removes those aliases, so any rule still using the old names must be updated.

In 4.1.0 the custom-rule interface and its context in the bpmn-to-code-testing module were renamed to make room for cross-process (multi-model) validation rules:

  • BpmnValidationRuleSingleModelValidationRule
  • ValidationContextSingleModelValidationContext

The old names stayed available as @Deprecated typealiases, so existing rules kept compiling. v5.0.0 removes them, so any rule still using the old names must be updated first.

Am I affected?

Only if you wrote custom validation rules and still reference BpmnValidationRule / ValidationContext. Built-in rules (BpmnRules.*), the fluent BpmnValidator API, and assertions are unaffected.

If you already migrated to the new names (or only use built-in rules), there is nothing to do.

Migrating

Update the type references:

kotlin
// Before
class RequireElementPrefixRule : BpmnValidationRule {
    override fun validate(context: ValidationContext): List<ValidationViolation> { /* ... */ }
}

// After
class RequireElementPrefixRule : SingleModelValidationRule {
    override fun validate(context: SingleModelValidationContext): List<ValidationViolation> { /* ... */ }
}

Imports change accordingly:

kotlin
// Before
import io.miragon.bpmn.domain.validation.BpmnValidationRule
import io.miragon.bpmn.domain.validation.model.ValidationContext

// After
import io.miragon.bpmn.domain.validation.SingleModelValidationRule
import io.miragon.bpmn.domain.validation.model.SingleModelValidationContext

Everything else — id, severity, phase, ValidationViolation, and how you register rules via withRules(...) — is unchanged. The new CrossModelValidationRule / CrossModelValidationContext (added in 4.1.0) are unaffected by the removal.