CMMN Concepts

CMMN (Case Management Model and Notation)

CaseMgr implements CMMN concepts for flexible, knowledge-work case management. Unlike rigid workflows, CMMN allows dynamic, event-driven execution.

Tasks

Tasks represent work items with full lifecycle state management:

available → enabled → active → completed
                ↓         ↓
            disabled   suspended → active
                          ↓
                      terminated
StateDescription
availableTask exists but conditions not yet met
enabledEntry criteria satisfied, can be started
activeWork in progress
suspendedPaused, preserves context for resumption
completedSuccessfully finished
terminatedStopped without completion
failedError or inability to complete

Stages

Stages are containers for grouping related plan items (tasks, milestones, other stages). They follow the same lifecycle as tasks.

{
  "name": "create_stage",
  "arguments": {
    "case_id": "#1:0",
    "name": "Authentication Phase",
    "status": "available",
    "auto_complete": true
  }
}

Milestones

Milestones represent achievements – no work, just marks completion. Simpler lifecycle:

available → completed
    ↓
terminated

Sentries

Sentries define entry/exit criteria that guard transitions. They are linked TO the items they guard.

PropertyDescription
sentry_type“entry” or “exit”
source_refItem ID to watch for events
standard_eventcomplete, terminate, create, update, delete
conditionExpression or description for AI to evaluate
satisfiedWhether criterion has been met

AI Usage Pattern

1. Create Stage: "Authentication Phase"
2. Create Tasks: "Design OAuth", "Implement OAuth", "Test OAuth"
3. Link tasks to stage via link_items
4. Create entry Sentry: "Design must be completed"
5. Create exit Sentry: "All tests must pass"
6. AI reads sentries, evaluates conditions, triggers transitions