8.18 Case management with CMMN¶
FeeCheck models its case in CMMN, the OMG's Case Management Model and Notation, and runs it on
Flowable's open-source CMMN engine inside the cases module (4.3). Chapter 6 draws the case
in CMMN (6.1); this page lists the notation those
diagrams use and gives the reasons for CMMN.
Sources: the CMMN specification at the OMG; Flowable's
CMMN guide; M. Kiener,
Using CMMN to go beyond case management,
Flowable, 7 November 2024; spec 15 (docs/specs/15-workflow-module.md), whose two models were run on
Flowable 8.
8.18.1 Legend — the notation of the CMMN diagrams¶
Mermaid has no CMMN diagram. Chapter 6 draws CMMN's elements in Mermaid's flowchart shapes and
names each one's CMMN type as a stereotype on its first line, so a diagram reads without the
legend. This is the one legend of every CMMN diagram in the architecture; chapter 6 links here. The
drawing rules are in docs/architecture/CLAUDE.md (docs/architecture/CLAUDE.md).
Every element once:
flowchart LR
p["«person»<br/>Person"]
ev((("«event listener»<br/>EventFromOutside")))
mod("«module»<br/>Stage module")
subgraph cs["«case» Case"]
direction LR
cst("«case start»<br/>Case start")
subgraph st["«stage» Stage"]
direction LR
pt("«process task»<br/>Process task")
ht("«human task»<br/>Human task")
se[/"«send event task»<br/>Send event task<br/>SomethingRequested"/]
sst("«stage start»<br/>Stage start")
dt("«decision task»<br/>Decision task")
pi("«plan item»<br/>Plan item")
tm{{"«timer event listener»<br/>Timer"}}
ex{"«exit criterion»<br/>Exit criterion"}
end
col["«stage» ⊞<br/>Collapsed stage"]
cfi[("«case file item»<br/>Case file item")]
ms(["«milestone»<br/>Milestone"])
ct[["«case task»<br/>Case task"]]
end
cst --> sst
sst --> pt
pt -.-> dt
dt -.-> pi
ev -.-> pt
pt -- "condition" --> ht
p -- "starts" --> ht
pt --> cfi
ht -.-> se
se -. "request" .-> mod
tm -. "deadline passed" .-> ex
ht -.-> ms
ms -.-> col
col -.-> ct
classDef person fill:#ffe8b0,stroke:#9a6b00,color:#000
classDef built fill:#b7e4c7,stroke:#2d6a4f,color:#000
classDef planned fill:#c6dcff,stroke:#1168bd,stroke-dasharray:4 3,color:#000
classDef external fill:#e6e6e6,stroke:#6b6b6b,color:#000
class p person
class cst,pt,cfi built
class ev,ht,se,tm,ex,col,ms,ct,sst,dt,pi planned
class mod built
style cs fill:none,stroke:#666
style st fill:none,stroke:#666
| Stereotype | CMMN element | What it is in FeeCheck | Shape | In Flowable |
|---|---|---|---|---|
| «case» | case, with its case plan model | one FeeCheck case per contract PDF; a child case is a case of its own | frame | a case instance of a deployed case definition |
| «stage» | stage, expanded | a phase of the case — Document preparation, Data capture; its plan items are available only while it is active | frame inside the case | stage |
| «stage» ⊞ | stage, collapsed | the same stage as a black box, its tasks drawn elsewhere; the overview 6.1 draws every stage in this form | rectangle, marked ⊞ | stage |
| «process task» | task, here a ProcessTask in the glossary's sense | work the case does itself | rounded rectangle | service task (a Java delegate) |
| «human task» | human task | work a person completes — confirm a document's type, release a blocked case, review and release findings; a candidate group says who may | rounded rectangle | human task, with candidate groups |
| «decision task» | decision task | a deterministic rule; a model call that classifies is not one; no FeeCheck diagram uses one yet | rounded rectangle | decision task (DMN) |
| «send event task» | — (Flowable's extension) | sends a stage request or a fact the case publishes (8.16.3); it completes when it has sent, and the waiting for a reply is an event listener in the stage task's sub-stage (6.1.2). In the stage diagrams one parallelogram with a request's name stands for that whole sub-stage | parallelogram, the event's name as its last line | send event task over the Event Registry |
| «case task» | case task | starts a child case — Fee reconciliation; marked ⊞ where it is drawn collapsed | rectangle with side bars | case task |
| «case file item» | case file item | a result the case holds — the contract PDF, the rendition, the extraction result, the findings (6.1) | cylinder | a case variable holding a reference to where the result is stored |
| «milestone» | milestone | a point the case has reached — Converted, Contract recorded, Released | stadium | milestone |
| «event listener» | event listener | the case waiting for a domain event from outside it — a reply, a document from another channel | double circle | Flowable's event-registry event listener, correlated by its correlation parameters (Flowable's extension; CMMN itself has timer and user event listeners) |
| «timer event listener» | timer event listener | a request's reply deadline | hexagon | timer event listener |
| «exit criterion» | exit criterion | where a stage task ends early — on a rejection or a missed reply deadline; CMMN draws it as a diamond on the stage's border | rhombus | exit sentry |
| «case start», «stage start» | — | where a case or stage begins; CMMN has no start node, so these are no plan items | rounded rectangle | the case's creation; a stage's entry criterion |
| «person» | — | a person who starts something: the upload, a task with manual activation — the arrow says what | person node | — |
| «plan item» | plan item, any type | a placeholder in a pattern drawn once — the item before and after a stage task in 6.1.2 | rounded rectangle | — |
| «module» | — | a stage module doing a request's work, outside the case | rounded rectangle | — |
| Line or colour | Meaning |
|---|---|
| arrow between plan items | a Sentry: the target's entry criterion, satisfied when the source completes or the milestone occurs; its label is the condition (CMMN's on-part and if-part) |
| arrow into an exit criterion | what ends the stage task early |
| arrow into or out of a cylinder | the task writes or reads the CaseFileItem |
| arrow across the case's frame | a domain event: a request out of the case, a reply or a fact into it |
| arrow from a person | the person starts it: the upload, or a task with manual activation |
| green | built |
| blue, dashed border | planned |
| grey | external system |
| light orange | person |
| solid arrow | a handoff between built elements |
| dotted arrow | a handoff with a planned end |
Three rules carry the rest of FeeCheck's model: manual activation — a plan item becomes enabled and waits for a person, as Extract attributes does; the required rule — a stage cannot complete while a required item has not, so a manually activated task cannot be skipped by the stage's auto-completion; and repetition, not used — a retry starts a failed stage task again through the engine's change of plan-item state (6.1.2).
8.18.2 Plan items and the business state¶
Every plan item has CMMN's lifecycle — available, enabled or disabled, active, then completed, terminated or failed — kept by the engine. FeeCheck keeps the case's business state as a record of its own beside it, derived from the stages and milestones by a lifecycle listener (6.1.1), and its own append-only audit trail; the engine's history is an index, not the audit trail (spec 15 §2).
8.18.3 Why CMMN¶
Trying CMMN out is one aim of the proof of concept; that is one reason, and it is stated as one. The others come from what the FeeCheck case is.
| The case needs | CMMN gives | A BPMN process | A state machine or stage diagram | Logic written by hand |
|---|---|---|---|---|
| People deciding in an order nobody can fix in advance — confirm a type, release a blocked case, review, release, retry | human tasks, manual activation and event-driven entry; CMMN is made for work done "in an unpredictable order in response to evolving situations" (OMG) | a fixed sequence with a gateway for every alternative path; ad-hoc work is awkward | states, but nobody who works, nothing about who may | every path coded and tested by hand |
| Reacting to events — a reply, a rejection, a missing reply, a document from another channel | Sentries on events, event listeners scoped to a stage, timers (Kiener) | message events in a sequence | transitions, without the waiting, the timers or the correlation | listeners, timers and correlation built by hand |
| Where a case stands, for the screen | stages and milestones that map to the business states (Kiener: stages as a state model) | a token position, not a business state | exactly this, and nothing else | a state field kept consistent by hand |
| Gates nobody may skip — nothing is released without a person (W-2, W-3; 8.2) | the model enforces them; a model can be checked before it is deployed (W-6) | also possible | describes them, enforces nothing | enforced wherever the code remembers to |
| A flow per customer without a code change (W-8, spec 15 §1) | a model deployed per tenant, with a fallback to the default | also possible | — | a code change and a release |
| Durable state, retries, timers, history | the engine's, in the same database as the case (8.3) | the engine's | — | written by hand: the case's own states, steps, claims, leases and attempt counting, each written and tested by hand |
Where a part of the work turns out strictly sequential, CMMN can call a BPMN process for it (Kiener: CMMN orchestrating BPMN); FeeCheck has no such part yet.
The price. An engine as a dependency, with its own tables and its own upgrades; Flowable's open source has no user interface, so FeeCheck builds its own (spec 15 §1); CMMN is less widely known than BPMN, and its tooling thinner; two Flowable extensions FeeCheck relies on — the send event task and the event-registry event listener — are not CMMN itself. The offline build runs the engine on H2 in memory, so the gate stays offline (8.16.3).