Warehouse execution (WES) · Supporting domain · EventStorming board
task-interleaving
After a station finishes a task, suggests the few nearest open tasks so operators walk less between jobs. Advice only: it never assigns or claims work.
- events published
- 4
- commands
- 10
- policies
- 10
- read models
- 6
- hot spots
- 4
The story in 4 key events
The pivotal events: the few that matter most, in the order they happen.
- Pivotal eventInterleaving
Policy Declared - Pivotal eventInterleaving
Hint Issued - Pivotal eventInterleaving
Hint Consumed - Pivotal eventInterleaving
Hint Expired
Listens to (2): contexts whose events this one reacts to
Tells (1): contexts that react to its events
The board, row by row
11 rows, in the order the business story happens: the main path first, then how this context reacts to the others, then the clock. Rows are small stories; read each one left to right.
- Event
- Command
- Actor
- Aggregate
- Policy
- Read model
- External system
- Hot spot
- Opportunity
-
Set a site's hint rules
An operator sets, for one site, how far a detour may be, how many suggestions to give, how long a hint lives and which task types qualify. Until a site has rules it gets no hints at all.
ActorOperatorCommandDeclareInterleaving PUT /sites/{siteId}/policyPolicy AggregatePolicyEventInterleavingPolicy analytics stream onlyDeclared Source: application/usecases/declare_policy.go · domain/policy/policy.go
-
Suggest the next tasks after a completion
A station finishes a task, so it now stands at that task's end point. If the site has rules, the nearest open tasks are ranked and issued as a hint. A new hint replaces the station's older live one.
Systemfulfillment-execution EventTaskCompleted PolicyWhenever a task is completed, record where the station stands and, if the site has rules, rank the nearest open tasksRead modelOpen tasksRead modelSite hint rulesRead modelLocation pointsCommandApplyTask started by the policyCompleted AggregateStationTrip EventInterleavingHint Issued Systemfulfillment-execution PolicyKeeps the hint and uses it to break a tie within one priority band when the station claims its next taskSource: application/usecases/apply_task_completed.go · application/usecases/ranker.go · domain/stationtrip/trip.go · domain/recommend/recommend.go
-
Notice that a hint was followed
A station claims a task. The task leaves the open list. If it was one of the live hint's suggestions and the hint had not run out, the hint counts as taken. Claiming any other task changes nothing.
Systemfulfillment-execution EventTaskClaimed PolicyWhenever a task is claimed, take it off the open list and mark the station's live hint taken if it named that taskCommandApplyTask started by the policyClaimed AggregateStationTrip EventInterleavingHint analytics stream onlyConsumed Read model · kept up to dateOpen tasksSource: application/usecases/apply_task_claimed.go · domain/stationtrip/trip.go
-
Let an unused hint expire
A hint lives only for the time the site's rules allow. A frequent sweep marks every live hint past its deadline as expired, even when the station does nothing.
TimeHint expiry sweepPolicyEvery few seconds, any live hint past its deadline is marked expiredCommandExpireHints started by the clockAggregateStationTrip EventInterleavingHint analytics stream onlyExpired Source: application/usecases/expire_hints.go · adapters/inbound/expiry/worker.go · domain/stationtrip/trip.go
-
Preview the advice for a station
Anyone can ask what the recommender would suggest for a station, from its last known position or from a location they name. It changes nothing and sends nothing.
ActorOperatorRead modelOpen tasksRead modelSite hint rulesRead modelLocation pointsCommandRecommendTasks POST /recommendationsSource: application/usecases/recommend.go · adapters/inbound/http/recommend_handler.go
-
Keep the open-task list
fulfillment-execution announces every task that becomes claimable. This context keeps its own copy of that pool, so it can rank tasks without asking. A task already completed never returns to it.
Systemfulfillment-execution EventTaskAvailable PolicyWhenever a task becomes claimable, add it to the open tasks with its type, site and locationsCommandApplyTask started by the policyAvailable Read model · kept up to dateOpen tasksSource: application/usecases/apply_task_available.go · adapters/inbound/kafka/fulfillment_consumer.go
-
Keep the zone list
facility-layout announces each zone of a site. Here the zone list links every location to its site, so a task's location can be placed on the right map.
Systemfacility-layout EventZoneRegistered PolicyWhenever a zone is registered, add it to the zone list with its siteCommandApplyZone started by the policyRead model · kept up to dateZonesSource: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go
-
Keep the location list
Each new storage location announced by facility-layout is added to the local list with its zone. Distances can only be measured between places listed here.
Systemfacility-layout EventLocationSlot Registered PolicyWhenever a location slot is registered, add it to the location list with its zoneCommandApplyLocation started by the policyRegistered Read model · kept up to dateLocationsSource: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go
-
Retire a location
When facility-layout takes a location out of service, it is retired in the local list for good.
Systemfacility-layout EventLocationSlot Decommissioned PolicyWhenever a location slot is decommissioned, retire it in the location listCommandApplyLocation started by the policyDecommissioned Read model · kept up to dateLocationsSource: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go
-
Keep the location points
facility-layout reports where a location sits on the floor, in metres. These points are what the distance between two places is measured from. A place with no point is skipped, never guessed.
Systemfacility-layout EventLocationGeometry Updated PolicyWhenever a location's position changes, store its new point, even if the location is not listed yetCommandApplyGeometry started by the policyUpdated Read model · kept up to dateLocation pointsSource: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go
-
Measure how much advice is followed
The service reads its own hint announcements and keeps a daily tally of hints issued, taken and expired. That tally feeds the hint adoption report.
Event · earlierInterleavingHint Issued PolicyWhenever a hint is issued, taken or expires, add it to that day's tallyRead model · kept up to dateHint adoption reportSource: adapters/inbound/kafka/analytics_consumer.go · 0008-analytics-read-side.md
Hot spots and opportunities
Open questions and known gaps, each taken from a decision record or a document in the repository, never invented. Opportunities are improvements the documentation already names.
- Hot spotA completion with no candidate leaves an older live hint in place until it expires. Retracting it would need a new event.
- Hot spotPACK, SLAM and REBIN tasks have no location in fulfillment-execution, so they are never announced and can never be hinted.
Source: docs/ddd/eventstorming.md
- Hot spotIt is assumed that fulfillment's site ids equal facility-layout's site codes and that one map frame covers a site. Not yet checked on live data.
- Hot spotA place with no known point is skipped, never guessed. Sparse map data means short hint lists or none at all.
Opportunities
- OpportunityA travel model aware of aisles, cross-aisles and fixed structures is a planned refinement of today's straight-line distance.
- OpportunityMulti-stop batching, cross-station balancing and hints on the station screen are named as later decisions.
This board is a reconstruction from the code and documentation of task-interleaving at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.