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. Every hotspot is a gap or risk that can be read in the model itself; the source of each is in the hotspot table. The network-wide board is EventStorming big picture.

Legend​

StickyColourMeaning here
Actorpale yellow #fff9dbStation planner, DSP driver app
Commandblue #a5d8ffa command of an aggregate (commands)
Aggregateyellow #ffec99DeliveryWave, Route, DeliveryServicePartner
Domain Eventorange #ffc078an event this context publishes or consumes
Policylilac #d0bfffInductOnArrival, RetryNextWave
Read Modelgreen #b2f2bbStationView, InboundPackagesView
External Systempink #fcc2d7a sibling context
Hotspotred #ff8787an open question or risk from the model

1. Scheduling waves and keeping station data​

Derived from: model.yaml → contexts[last-mile-delivery].aggregates[DeliveryWave], .read_models[StationView], .publishes, .consumes; contexts[delivery-promise].read_models[DeliveryWaveView].

Omitted: the list-waves query; the outbox between aggregate and event.

2. Induction on arrival​

Derived from: model.yaml → contexts[last-mile-delivery].policies[InductOnArrival], .read_models, .aggregates[DeliveryWave].invariants, .publishes[DeliveryWaveCapacityChanged]; contexts[linehaul-transportation].publishes[LoadArrived].

Omitted: the invariants ErrWaveFull and ErrInductionClosed, which make the policy try the next wave.

3. Routes and dispatch​

Derived from: model.yaml → contexts[last-mile-delivery].aggregates[Route], .aggregates[DeliveryServicePartner], .aggregates[DeliveryWave].transitions, .publishes[RoutePlanned, PackageOutForDelivery].

Omitted: ErrRouteOverCapacity (the van-capacity check on PlanRoute). CompleteWave has no caller: it runs automatically (ADR 0002 A9).

4. Attempts and retries​

Derived from: model.yaml → contexts[last-mile-delivery].policies[RetryNextWave], .aggregates[Route].entities, .aggregates[Route].invariants, .publishes[DeliveryAttempted].

Omitted: ErrRouteNotStarted and ErrAlreadyDelivered, and shipping-and-tracking's journey transitions.

Hotspots​

#HotspotWhere it comes from in the model
H1A suspended or retired station can still get waves.read_models[StationView].source lists only NodeRegistered, ServiceAreaAssigned; node-topology does not list this context as a consumer of NodeSuspended or NodeRetired. DeliveryWave.invariants has no station check; the use case checks the node is a known DELIVERY_STATION at ScheduleWave (ADR 0002 A1).
H2Resolved: DeliveryWaveCancelled reaches the promise and sourcing.publishes[DeliveryWaveCancelled].consumers lists delivery-promise and order-sourcing; the event goes to the integration stream (ADR 0002 A22).
H3Resolved: CancelWave has a REST route; CompleteWave and CompleteRoute are automatic and have none.POST /waves/{waveId}/cancellations; ADR 0002 A9 (a wave completes with its last route, or at once when dispatched with no route) and A16 (a route completes after the attempt that records its last package).
H4Resolved (G11): capacity is in stops, induction is per package, and stops are grouped by the opaque stopKey of LabelIssued, never by an address.StopCapacity{stops, assigned}, Stop{stopNo, trackingNumbers[], outcome}, read_models[PackageStopView], policies[GroupByStopKey]; the address stays in customer-ordering and shipping-and-tracking (ADR 0006) and no address route exists (policies[NoAddressAtLastMile]).
H5When no wave is eligible, nobody hears about it.InductOnArrival has no failure outcome and no event; only shipping-and-tracking's ExceptionOnSilence would surface it later.
H6"Three failures return it to sender" has no home.RetryNextWave.rule; no aggregate holds a failure count across routes; no event or command carries the return to sender; shipping-and-tracking's ReturnToSender has no inbound trigger from this context.
H7A stop has one outcome, an attempt is per package.Route.entities Stop{..., outcome} against DeliveryAttempted.data (trackingNumber, outcome).