Skip to content

schema: Milestone YAML definition missing slaDuration, slaStartFrom, entryCriteria fields #420

@treblereel

Description

@treblereel

Problem

The Milestone Java API class (api/model/Milestone.java) supports three fields that have no corresponding entries in the YAML JSON Schema (schema/src/main/resources/schema/CaseDefinition.yaml) and are not wired in CaseDefinitionYamlMapper:

Field Java API YAML Schema Mapper
slaDuration Duration via builder missing not wired
slaStartFrom SlaStartFrom enum (MILESTONE_ACTIVATED, CASE_CREATED) missing not wired
entryCriteria ExpressionEvaluator via builder missing not wired — defaults to always-true

Currently milestone SLA tracking and entry criteria are only configurable via the Java DSL (Milestone.builder().slaDuration(...).slaStartFrom(...).entryCriteria(...)). YAML-defined cases cannot use these features.

Expected YAML

milestones:
  - name: approval
    condition: '.approved == true'
    entryCriteria: '.submitted == true'
    slaDuration: PT2H
    slaStartFrom: MILESTONE_ACTIVATED

Scope

  1. Add slaDuration (ISO-8601 duration string), slaStartFrom (enum: MILESTONE_ACTIVATED | CASE_CREATED), and entryCriteria (JQ string) to the Milestone definition in CaseDefinition.yaml
  2. Wire the three fields in CaseDefinitionYamlMapper.convertToApiModel() milestone conversion block
  3. Add validation: slaDuration must be positive if present; slaStartFrom defaults to MILESTONE_ACTIVATED
  4. Add unit tests in CaseDefinitionYamlMapperTest for the new fields
  5. Add a YAML example exercising milestone SLA

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions