Skip to main content

EventStorming

As built

Derived from network/model/model.yaml. This context's service is built; the model carries its as-built contracts, and identifiers (Err... names, routes, CloudEvents types) are the names the service uses.

Process-level EventStorming in the ddd-crew EventStorming glossary & cheat sheet notation. Every sticky is a command, aggregate, event, policy or read model of the model. Events of other contexts appear as orange stickies next to the pink system that publishes them. Hotspots are real open questions or risks of the model; each says where it comes from. The domain-wide board is the big-picture EventStorming.

Legend​

StickyColourMeaning here
Commandblue #a5d8ffa command of DeliveryOffer, Promise or PromiseBook
Aggregateyellow #ffec99DeliveryOffer, Promise, PromiseBook
Domain Eventorange #ffc078an event this context publishes, or one it consumes
Policylilac #d0bfffa policy of the model (PromisePolicy, RepromiseOnRisk, ...) or a reaction to an event
Read Modelgreen #b2f2bbone of the seven event-fed views
External Systempink #fcc2d7another bounded context, the shopper's storefront, or the clock
Hotspotred #ff8787an open question or risk in the model

1. Feeding the read models​

1a. Topology and availability​

1b. Departures, waves and scorecards​

Derived from: model.yaml → contexts[delivery-promise].read_models, .consumes; conventions.integration_rules; H1 (resolved) from contexts[last-mile-delivery].publishes[DeliveryWaveCancelled].consumers, which lists this context, and contexts[delivery-promise].policies[RepromiseOnRisk].

Omitted: DepartureCancelled's second effect, the re-promise (board 5). Board 1 is split in two, and boards 2 to 6 are drawn top to bottom, to stay within the page width.

2. Quoting a delivery offer​

Derived from: model.yaml → contexts[delivery-promise].aggregates[DeliveryOffer] (commands, notes), .policies; H2 from .aggregates[DeliveryOffer].description against .aggregates[Promise].value_objects[ShipmentGroup] and .publishes[PromiseMade].data (one offerId); H3 from .policies[TierOrderDeadline] (no aggregate, route or event carries it); H4 from conventions.integration_rules (the promise hot path makes no synchronous call).

Omitted: the four OfferConstraint values returned for a tier with no offer, and the search steps (on the use cases page and in the promise model).

3. Making a promise and holding capacity​

Derived from: model.yaml → contexts[delivery-promise].aggregates[Promise], .aggregates[PromiseBook], .aggregates[DeliveryOffer].transitions, .publishes[PromiseBookExhausted].consumers; H5 (resolved by G9) from .aggregates[PromiseBook] (OpenBook, BookTimes) and .policies[LazyBookOpening, BookShare, CloseBooksAtCutoff].

Omitted: the refusals (ErrOfferNotQuotable, ErrPromiseCapacityExhausted, ErrBookClosed, ErrGroupSpansNodes), listed on the use cases page.

4. Confirming, releasing and closing​

Derived from: model.yaml → contexts[delivery-promise].aggregates[Promise].transitions (PROVISIONAL → CONFIRMED, PROVISIONAL → RELEASED), .aggregates[PromiseBook].commands, .consumes[CustomerOrderPlaced], .policies[ConfirmOnOrderPlaced]; H6 from .aggregates[Promise].invariants (ErrPromiseHoldExpired): the consumer logs a lapsed group and skips it (never retried), confirms the other groups, and the ReleaseExpiredHolds clock job releases the lapsed promise.

Omitted: nothing about the trigger. A clock job closes every OPEN book at its cutoffAt (policies[CloseBooksAtCutoff]); holds are already refused from the holdDeadline, the cutoff minus handling time.

5. Re-promising when the path breaks​

Derived from: model.yaml → contexts[delivery-promise].policies[RepromiseOnRisk], .aggregates[Promise].transitions, .publishes[PromiseAtRisk, PromiseRevised].consumers; H7 from .aggregates[PromiseBook].commands (no rule ties RevisePromise to HoldCapacity / ReleaseCapacity).

Omitted: CONFIRMED → CONFIRMED: RevisePromise (a revision without passing through AT_RISK, which the model allows but no policy uses); the case where nothing is feasible even at STANDARD (the promise stays AT_RISK, board 6).

6. Judging and cancelling​

Derived from: model.yaml → contexts[delivery-promise].policies[JudgeOnDelivery], .publishes[PromiseKept, PromiseBroken, PromiseCancelled], .consumes; H8 from .consumes[FulfillmentLocked] with no policy or read model using it, and contexts[shipping-and-tracking].publishes[PackageDelivered].data (no promiseId, no groupNo); H9 (resolved) from contexts[shipping-and-tracking].publishes[PackageLost, PackageReturned].consumers, which list this context, and policies[JudgeOnDelivery, SharedTrackingJudgement].

Omitted: the capacity release on cancellation (ReleaseCapacity, board 4). The cancellation policy sticky is this pack's reading: the model consumes CustomerOrderCancelled and has CancelPromise, but names no policy joining them.

Hotspot inventory​

IdHotspotWhere it comes from in the modelBoard
H1Resolved: a cancelled delivery wave is consumed (DeliveryWaveCancelled): the wave is marked cancelled in DeliveryWaveView and every active promise whose witness wave it is is flagged AT_RISK with reason WAVE_CANCELLEDDeliveryWaveCancelled consumers list this context; policies[RepromiseOnRisk]1
H2An offer is per item; a promise covers a multi-line group with one offerIdDeliveryOffer.description vs ShipmentGroup, PromiseMade.data2
H3TierOrderDeadline has no owner, route or eventpolicies[TierOrderDeadline]2
H4The hot path is only as fresh as its slowest topicconventions.integration_rules2
H5Resolved (G9): the first hold opens the book (OpenBook), share has a formula, a clock job closes the book at cutoffAtaggregates[PromiseBook], policies[LazyBookOpening, BookShare, CloseBooksAtCutoff]3
H6A CustomerOrderPlaced that arrives after hold expiry: the lapsed group is skipped with a warning log (never retried), the other groups are confirmed and the ReleaseExpiredHolds sweeper releases the lapsed promise; customer-ordering still never learns that the placed order has no held promiseErrPromiseHoldExpired, policies[ConfirmOnOrderPlaced]4
H7Capacity on revision is unspecifiedaggregates[PromiseBook].commands, policies[RepromiseOnRisk]5
H8FulfillmentLocked has no stated use; packages carry no promiseIdconsumes[FulfillmentLocked], PackageDelivered.data6
H9Resolved: a lost or returned package's promise is judged BROKEN (cause LOST or RETURNED) for every promise that shares the tracking number (ADR 0025)PackageLost, PackageReturned consumers list this context; policies[JudgeOnDelivery, SharedTrackingJudgement]6