Warehouse execution (WES) · Generic domain · EventStorming board

process-path-management

Keeps the warehouse's catalogue of process paths, the order of stages work flows through, and each site's carrier cut-off schedule, and announces every change.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
7
commands
8
policies
31
read models
4
hot spots
4

The story in 4 key events

The pivotal events: the few that matter most, in the order they happen.

  1. Pivotal eventProcessPathCreated
  2. Pivotal eventProcessPathUpdated
  3. Pivotal eventProcessPathDeactivated
  4. Pivotal eventCPTScheduleChanged

Listens to (0): contexts whose events this one reacts to

none

Tells (8): contexts that react to its events

The board, row by row

10 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. Define a new process path

    An operator adds a path to the catalogue: its name prefix, the skills it needs, its p95 cycle time and which demand sources may feed it. A path id is never reused, even after retirement.

    ActorOperator
    CommandDefinePathPOST /process-paths
    AggregateProcessPath
    EventProcessPathCreated
    Systemfulfillment-execution
    PolicyAdds the path to its catalogue copy, so released work for it is accepted and gets its required skills
    Systemwes-work-planning
    PolicyAdds the path to its catalogue copy, so work can be planned onto it
    Systemworkforce-management
    PolicyAdds the path to its catalogue copy, so shift plans and assignments can name it
    Systemorder-management
    PolicyAdds the path, with its cycle time and eligibility, to the copy it uses to route orders
    Systemnetwork-fulfillment
    PolicyAdds the path's cycle time to the copy it uses for capacity figures

    Source: application/usecases/define_path.go · domain/processpath/process_path.go · domain/shared/events.go

  2. Revise a process path

    An operator changes an active path's prefix, skills, cycle time, eligibility or intake. If nothing actually changed, nothing is announced. The full new definition is sent, never a diff.

    ActorOperator
    CommandRevisePathPUT /process-paths/{pathId}
    AggregateProcessPath
    EventProcessPathUpdated
    Systemfulfillment-execution
    PolicyReplaces its copy of the path definition
    Systemwes-work-planning
    PolicyReplaces its copy of the path definition
    Systemworkforce-management
    PolicyReplaces its copy of the path definition
    Systemorder-management
    PolicyReplaces its copy, so the next delivery promise uses the new cycle time and eligibility
    Systemnetwork-fulfillment
    PolicyReplaces the cycle time it uses for capacity figures

    Source: application/usecases/revise_path.go · domain/processpath/process_path.go

  3. Retire a process path

    An operator retires a path for good. It is refused while a site's cut-off schedule or an active process flow still uses it, so the operator changes those first.

    ActorOperator
    Read modelSites whose schedule lists the path
    Read modelActive flows that use the path
    CommandDeactivatePathDELETE /process-paths/{pathId}
    AggregateProcessPath
    EventProcessPathDeactivated
    Systemfulfillment-execution
    PolicyRemoves the path from its catalogue copy
    Systemwes-work-planning
    PolicyRemoves the path from its catalogue copy
    Systemworkforce-management
    PolicyRemoves the path from its catalogue copy
    Systemorder-management
    PolicyRemoves the path from its copy, so no order is routed onto it
    Systemnetwork-fulfillment
    PolicyRemoves the path from its capacity copy

    Source: application/usecases/deactivate_path.go · domain/processpath/process_path.go · adr/0026-reject-deactivation-of-paths-in-cpt-schedules.md · adr/0028-close-path-cpt-schedule-race-with-row-locks.md · adr/0042-process-flows.md

  4. Publish a site's cut-off schedule

    An operator sets, or replaces in full, a site's carrier cut-off times. Every path a cut-off lists must be active. An identical schedule changes nothing and announces nothing.

    ActorOperator
    Read modelActive process paths
    CommandDefineCPTSchedulePUT /sites/{siteId}/cpt-schedule
    AggregateCPTSchedule
    EventCPTScheduleChanged
    Systemorder-management
    PolicyReplaces the site's cut-off windows it uses to promise delivery times
    Systemnetwork-fulfillment
    PolicyReplaces the site's cut-offs it uses for capacity figures
    Systemoutbound-shipping
    PolicyReplaces its copy of the site's cut-off schedule
    Systemdock-scheduling
    PolicyStores the site's cut-offs as a view; it books no appointment from them yet

    Source: application/usecases/cpt_schedule.go · domain/cptschedule/cpt_schedule.go · domain/cptschedule/events.go

  5. Define or revise a process flow

    An operator lays out the order of stages a workload passes through, for example pick, rebin, pack, label. Each stage must be an active path. A request that changes nothing announces nothing.

    ActorOperator
    Read modelActive process paths
    CommandDefineProcessFlowPUT /process-flows/{flowId}
    AggregateProcessFlow
    EventProcessFlowDefined
    EventProcessFlowRevised
    Systemwarehouse-planning
    PolicyKeeps a copy of the flow; a path id with an active flow is planned stage by stage, the slowest binds

    Source: application/usecases/process_flow.go · domain/processflow/process_flow.go · adr/0042-process-flows.md

  6. Retire a process flow

    An operator retires a flow. A retired flow cannot be revised again, and its paths may then be retired too.

    ActorOperator
    CommandRetireProcessFlowDELETE /process-flows/{flowId}
    AggregateProcessFlow
    EventProcessFlowRetired
    Systemwarehouse-planning
    PolicyStops using the flow and falls back to its own path of that id, if any

    Source: application/usecases/process_flow.go · domain/processflow/process_flow.go · adr/0042-process-flows.md

  7. Replay every active path at start-up

    When the service starts, it announces the current definition of each active path again. This way a consumer that rebuilds its catalogue from scratch never misses a path whose first event has aged out.

    TimeService start
    PolicyWhenever the service starts, announce every active path again
    CommandRepublishCataloguea background job
    AggregateProcessPath
    EventProcessPathUpdated
    Systemfulfillment-execution
    PolicyA fresh instance rebuilds its catalogue copy from the replay
    Systemwes-work-planning
    PolicyA fresh instance rebuilds its catalogue copy from the replay
    Systemworkforce-management
    PolicyA fresh instance rebuilds its catalogue copy from the replay

    Source: application/usecases/republish_catalogue.go · cmd/pathmgmt/republish.go · adr/0038-republish-catalogue-on-start.md

  8. Replay every site's schedule at start-up

    In the same start-up pass, the current cut-off schedule of each site is announced again, in full, for the same reason: a fresh consumer must be able to rebuild its copy.

    TimeService start
    PolicyWhenever the service starts, announce every site's schedule again
    CommandRepublishCataloguea background job
    AggregateCPTSchedule
    EventCPTScheduleChanged
    Systemorder-management
    PolicyA fresh instance rebuilds its cut-off copy from the replay
    Systemnetwork-fulfillment
    PolicyA fresh instance rebuilds its cut-off copy from the replay

    Source: application/usecases/republish_catalogue.go · cmd/pathmgmt/republish.go · adr/0038-republish-catalogue-on-start.md

  9. Replay every active flow at start-up

    At start-up each active flow is announced again as revised, with its current version. A consumer that is caught up ignores it; a fresh one learns the flow. Retired flows are not replayed.

    TimeService start
    PolicyWhenever the service starts, announce every active flow again
    CommandRepublishCataloguea background job
    AggregateProcessFlow
    EventProcessFlowRevised
    Systemwarehouse-planning
    PolicyKeeps the flow only if its version is newer than the copy held

    Source: application/usecases/republish_catalogue.go · adr/0042-process-flows.md

  10. Count catalogue growth for reports

    The service reads its own path announcements and keeps a daily tally of paths defined, revised and retired, which feeds the catalogue growth report. It never reads another context's events.

    Event · earlierProcessPathCreated
    PolicyWhenever a path is created, revised or retired, add one to that day's tally
    CommandApplyProcessPathCreatedstarted by the policy
    Read model · kept up to dateCatalogue growth report

    Source: adapters/inbound/kafka/analytics_consumer.go · adr/0007-analytical-data-product.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 process-path-management at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.