ADR-020 — Object Lifecycle Model¶
Status¶
Accepted
Context¶
UC-BoK models Business Objects (ADR-007) and Domain Events (ADR-009), but does not formally specify the valid states a Business Object can occupy, or the allowed transitions between those states. This creates three problems:
- Integration ambiguity — system integrators must infer valid state sequences from process diagrams or vendor documentation, leading to inconsistent implementations.
- Event orphaning — domain events such as
order-confirmedorreturn-approvedare defined but not anchored to a source state or target state in the canonical model. - Assessment gaps — the UCMI maturity model cannot assess whether a platform handles the complete lifecycle of a business object (e.g. does it support partial fulfilment? split orders? post-delivery returns?).
A formal lifecycle model resolves all three by making state machines a first-class citizen of the UC-BoK knowledge graph.
Decision¶
UC-BoK introduces an Object Lifecycle Model as a new catalog layer under
catalogs/lifecycles/.
Lifecycle definition¶
Each lifecycle YAML defines:
| Field | Required | Description |
|---|---|---|
id |
✓ | Stable kebab-case identifier (e.g. order-lifecycle) |
name |
✓ | Display name |
object |
✓ | Reference to the Business Object id it models |
description |
✓ | Purpose and scope |
states |
✓ | Ordered list of valid states |
transitions |
✓ | Allowed state transitions |
State definition¶
states:
- id: draft # kebab-case
label: Draft # display
description: ...
initial: true # exactly one state per lifecycle
terminal: false # true for end states
Transition definition¶
transitions:
- id: confirm-order
from: draft
to: confirmed
trigger: order-confirmed # domain event id (from events.yaml)
guards: # pre-conditions (plain language)
- Payment authorization obtained
- All lines have available stock
notes: ... # optional
Invariants¶
- Every lifecycle has exactly one
initial: truestate. - Terminal states have no outbound transitions.
- Every
triggermust resolve to an event id incatalogs/events.yaml. - Every
fromandtomust reference a valid state id in the same lifecycle. - A state may have multiple inbound transitions (fan-in is allowed).
- A state may have multiple outbound transitions (fan-out is allowed, guards distinguish them).
Scope¶
The initial set covers the five Aggregate Root objects with the highest process coverage in UC-BoK:
| Object | Lifecycle id |
|---|---|
order |
order-lifecycle |
basket |
basket-lifecycle |
return |
return-lifecycle |
fulfillment-order |
fulfillment-order-lifecycle |
payment |
payment-lifecycle |
Future work: reservation, shipment, loyalty-account.
Consequences¶
catalogs/lifecycles/*.yamlis the canonical source of truth for object lifecycles.- Domain events classified as
transitionedinevents.yamlmust be reachable from at least one lifecycle transition trigger. scripts/generate_lifecycle_docs.pygenerates MermaidstateDiagram-v2diagrams and transition tables for each lifecycle.- Two new MCP tools expose lifecycle data to AI agents:
list_lifecyclesandget_lifecycle. - The UCMI assessment engine may reference lifecycle completeness in future scoring.
- Lifecycle state ids are intentionally lowercase kebab-case (not SCREAMING_SNAKE) to stay consistent with UC-BoK identifier conventions.
Related¶
- ADR-007 Business Object Ontology
- ADR-009 Event Ontology
- ADR-012 Semantic Constraints