Warehouse execution (WES) · Supporting domain · EventStorming board

exception-management

Gives every problem another context detects one owner: a case with severity, queue, deadline and root cause. Cases only ever start from a fact.

GitHub ↗ · Documentation ↗ · Architecture check · Briefings

events published
7
commands
9
policies
12
read models
3
hot spots
5

The board, row by row

16 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. Open a case for a missed cut-off

    A task is past its cut-off time. The first report opens a case with the severity, queue and deadline its policy sets. The report repeats at every sweep, so a repeat only adds to the count. A diverted or wrongly weighed package works the same way.

    Systemfulfillment-execution
    EventTaskCPTMissed
    PolicyWhenever a task misses its cut-off, open a case, or count it on the case already open
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · application/usecases/consume_fact.go · adapters/inbound/kafka/fulfillment_consumer.go · domain/exceptioncase/case.go

  2. Triage a case

    An operator sets the severity and the queue of a case. It works on an escalated case too. A resolved case refuses it.

    ActorOperator
    CommandTriageExceptionPOST /exceptions/{caseId}/triage-decisions
    AggregateCase
    EventExceptionTriaged

    Source: application/usecases/commands.go · domain/exceptioncase/case.go

  3. Assign a case to an owner

    An operator gives the case an owner. It can be reassigned until the case is resolved.

    ActorOperator
    CommandAssignExceptionPOST /exceptions/{caseId}/assignments
    AggregateCase
    EventExceptionAssigned

    Source: application/usecases/commands.go · domain/exceptioncase/case.go

  4. Resolve a case with a root cause

    An operator closes the case with a resolution code and a root cause. Resolved is final: later commands are refused, and a later matching fact only adds to the count, it never reopens the case.

    ActorOperator
    CommandResolveExceptionPOST /exceptions/{caseId}/resolutions
    AggregateCase
    EventExceptionResolved

    Source: application/usecases/commands.go · domain/exceptioncase/case.go

  5. Set how a kind of problem is handled

    An operator declares the severity, queue, deadline in minutes and an optional auto-close rule for one kind of fact. Each declaration is a new version. Cases already open keep what they were opened with.

    ActorOperator
    CommandDeclareExceptionPolicyPUT /exception-policies/{sourceType}
    AggregatePolicy
    EventExceptionPolicyDeclared

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

  6. Open a case for a work backlog

    wes-work-planning raises an alarm when the waiting work on a process path passes its threshold. The case is kept per path, and the alarm carries nothing but the path.

    Systemwes-work-planning
    EventBacklogThresholdBreached
    PolicyWhenever a backlog threshold is breached, open a case for that path, or count it on the open one
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · adapters/inbound/kafka/work_planning_consumer.go

  7. Open a case for a late network order

    An order sent to another site is at risk of missing its acknowledgement deadline, or its hold was cancelled as orphaned. One case is kept per network order. The report repeats while the risk lasts.

    Systemnetwork-fulfillment
    EventAcknowledgementDeadlineAtRisk
    PolicyWhenever a network order is at risk, open a case for it, or count it on the open one
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · adapters/inbound/kafka/network_fulfillment_consumer.go

  8. Open a case for an unexpected return

    A return arrives that nobody announced. One case is kept per return receipt.

    Systemreturns-processing
    EventUnexpectedReturnReceived
    PolicyWhenever an unexpected return is received, open a case for its receipt, or count it on the open one
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · adapters/inbound/kafka/returns_consumer.go

  9. Open a case for a carton problem

    Receiving reports a carton that does not match its ASN. Missing, unexpected or mismatched cartons go to the problem-solve queue. Unlabelled or over-limit ones go to the receiving lead as low-priority information.

    Systeminbound-receiving
    EventCartonDiscrepancyRaised
    PolicyWhenever a carton discrepancy is raised, open one case per receipt, carton and kind, routed by kind
    Read modelRoutes by kind of carton problem
    CommandOpenCartonDiscrepancystarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/carton_discrepancy.go · adapters/inbound/kafka/carton_discrepancy_consumer.go · 0006-carton-discrepancy-consumer-and-routing.md

  10. Open a case for a yard problem

    A trailer's seal differs from the one declared, a visit was turned away, a trailer overstayed, or a yard audit found a trailer missing. Each goes to the yard supervisor. A seal mismatch is the only high-severity one.

    Systemyard-management
    EventSealExceptionRaised
    PolicyWhenever the yard reports a seal mismatch, rejected visit, long stay or audit finding, open a case
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/yard_check.go · adapters/inbound/kafka/yard_exceptions_consumer.go · 0010-yard-exceptions-consumers-and-routing.md

  11. Open a case for a missed appointment

    A carrier never showed for its dock appointment. One case is kept per appointment and goes to the dock planner.

    Systemdock-scheduling
    EventDockAppointmentNoShow
    PolicyWhenever an appointment is a no-show, open a case for it, or count it on the open one
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · adapters/inbound/kafka/dock_scheduling_exceptions_consumer.go · 0010-yard-exceptions-consumers-and-routing.md

  12. Open a case for a stock problem

    A bin count disagrees with the books, an item cannot be found, or a unit is put on hold. Each opens a case. A held unit gets exactly one, however often it is reported.

    Systeminventory-storage
    EventDiscrepancyDetected
    PolicyWhenever stock is in doubt or held, open a case for the bin or unit, or count it on the open one
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · adapters/inbound/kafka/inventory_exceptions_consumer.go · adapters/inbound/kafka/held_stock_consumer.go

  13. Open a case for a package that missed its truck

    A package was not loaded by its cut-off or by the trailer's departure. One case is kept per package, even if it misses a later load too. It goes to the problem solvers.

    Systemoutbound-shipping
    EventPackageMissedLoad
    PolicyWhenever a package misses its load, open a case for the package, or count it on the open one
    Read modelHandling policy for this kind of fact
    CommandOpenOrTouchExceptionstarted by the policy
    AggregateCase
    EventExceptionOpened

    Source: application/usecases/open_or_touch.go · adapters/inbound/kafka/outbound_shipping_consumer.go · 0011-package-missed-load-consumer.md

  14. Escalate a case past its deadline

    A sweep, once a minute by default, flags every open case that is past its deadline. Escalation is a flag set once per case. It never blocks work: the case can still be triaged, assigned and resolved.

    TimeSLA sweep
    PolicyEvery sweep, any open case past its deadline and not yet flagged is escalated, once
    CommandSweepSLABreachesstarted by the clock
    AggregateCase
    EventExceptionEscalated

    Source: application/usecases/sweep_sla.go · domain/exceptioncase/case.go

  15. Close a case when the order is re-promised

    order-management re-promises an order. If an open cut-off case belongs to that order, and its policy has an auto-close rule whose time window has not passed, the case closes itself. No match leaves it open.

    Systemorder-management
    EventOrderRepromised
    PolicyWhenever an order is re-promised, close the matching open case if its policy rule allows
    Read modelOpen cases
    Read modelHandling policy for this kind of fact
    CommandAutoResolveOnCorrelationstarted by the policy
    AggregateCase
    EventExceptionAutoResolved

    Source: application/usecases/auto_resolve.go · adapters/inbound/kafka/order_correlation_consumer.go · domain/exceptionpolicy/rule.go

  16. Close a held-stock case when the hold ends

    When held stock is released, returned to the vendor or scrapped, its case closes with the outcome in the note. Rework keeps the case open and counts another round.

    Systeminventory-storage
    EventStockDispositioned
    PolicyWhenever held stock is released, returned or scrapped, close the case of that unit
    Read modelOpen cases
    CommandAutoResolveHeldStockstarted by the policy
    AggregateCase
    EventExceptionAutoResolved

    Source: application/usecases/held_stock.go · adapters/inbound/kafka/held_stock_consumer.go · 0012-held-stock-exception-cases.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 exception-management at origin/develop, not a workshop output. Roles are the ones the documentation names. How the boards were made.