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.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

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.

  1. Pivotal eventInterleavingPolicyDeclared
  2. Pivotal eventInterleavingHintIssued
  3. Pivotal eventInterleavingHintConsumed
  4. Pivotal eventInterleavingHintExpired

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
  1. 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.

    ActorOperator
    CommandDeclareInterleavingPolicyPUT /sites/{siteId}/policy
    AggregatePolicy
    EventInterleavingPolicyDeclaredanalytics stream only

    Source: application/usecases/declare_policy.go · domain/policy/policy.go

  2. 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 tasks
    Read modelOpen tasks
    Read modelSite hint rules
    Read modelLocation points
    CommandApplyTaskCompletedstarted by the policy
    AggregateStationTrip
    EventInterleavingHintIssued
    Systemfulfillment-execution
    PolicyKeeps the hint and uses it to break a tie within one priority band when the station claims its next task

    Source: application/usecases/apply_task_completed.go · application/usecases/ranker.go · domain/stationtrip/trip.go · domain/recommend/recommend.go

  3. 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.

    PolicyWhenever a task is claimed, take it off the open list and mark the station's live hint taken if it named that task
    CommandApplyTaskClaimedstarted by the policy
    AggregateStationTrip
    EventInterleavingHintConsumedanalytics stream only
    Read model · kept up to dateOpen tasks

    Source: application/usecases/apply_task_claimed.go · domain/stationtrip/trip.go

  4. 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 sweep
    PolicyEvery few seconds, any live hint past its deadline is marked expired
    CommandExpireHintsstarted by the clock
    AggregateStationTrip
    EventInterleavingHintExpiredanalytics stream only

    Source: application/usecases/expire_hints.go · adapters/inbound/expiry/worker.go · domain/stationtrip/trip.go

  5. 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.

    ActorOperator
    Read modelOpen tasks
    Read modelSite hint rules
    Read modelLocation points
    CommandRecommendTasksPOST /recommendations

    Source: application/usecases/recommend.go · adapters/inbound/http/recommend_handler.go

  6. 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 locations
    CommandApplyTaskAvailablestarted by the policy
    Read model · kept up to dateOpen tasks

    Source: application/usecases/apply_task_available.go · adapters/inbound/kafka/fulfillment_consumer.go

  7. 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 site
    CommandApplyZonestarted by the policy
    Read model · kept up to dateZones

    Source: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go

  8. 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
    EventLocationSlotRegistered
    PolicyWhenever a location slot is registered, add it to the location list with its zone
    CommandApplyLocationRegisteredstarted by the policy
    Read model · kept up to dateLocations

    Source: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go

  9. Retire a location

    When facility-layout takes a location out of service, it is retired in the local list for good.

    Systemfacility-layout
    EventLocationSlotDecommissioned
    PolicyWhenever a location slot is decommissioned, retire it in the location list
    CommandApplyLocationDecommissionedstarted by the policy
    Read model · kept up to dateLocations

    Source: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go

  10. 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
    EventLocationGeometryUpdated
    PolicyWhenever a location's position changes, store its new point, even if the location is not listed yet
    CommandApplyGeometryUpdatedstarted by the policy
    Read model · kept up to dateLocation points

    Source: application/usecases/apply_layout.go · adapters/inbound/kafka/layout_consumer.go

  11. 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 · earlierInterleavingHintIssued
    PolicyWhenever a hint is issued, taken or expires, add it to that day's tally
    Read model · kept up to dateHint adoption report

    Source: 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.

Opportunities

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.