Events Consumed by Process Path

Overview

This document catalogs all domain events that the Process Path bounded context consumes from other services. These events drive routing decisions, capacity management, and orchestration.


Implementation Status

All events in this document have been implemented. See the corresponding handler classes in each service.


Event Processing Overview

flowchart TD
    subgraph Sources["EXTERNAL EVENT SOURCES"]
        OM[Order Management]
        INV[Inventory Service]
        WES[WES Orchestration]
        WAVE[Wave Planning]
        WL[Workload Planning]
        TRACK[Physical Tracking]
        ROBOT[Robotics Fleet]
        PACK[Pack & Ship]
    end

    subgraph RoutingService["ROUTING SERVICE"]
        R_OM[OrderReleasedHandler<br/>OrderCancelledHandler]
        R_INV[InventoryAllocatedHandler]
        R_WES[WorkReleaseAuthorizedHandler<br/>CircuitBreakerHandler]
        R_WAVE[WaveReleasedHandler]
        R_ALGO[Path Assignment<br/>Algorithm]
    end

    subgraph OrchService["ORCHESTRATION SERVICE"]
        O_WL[CapacityForecastHandler<br/>LaborAvailabilityHandler]
        O_TRACK[ShipmentLocationHandler<br/>DwellTimeHandler<br/>AnomalyHandler]
        O_ROBOT[RobotTaskCompletedHandler<br/>PodDeliveredHandler]
        O_CAP[Capacity<br/>Management]
    end

    subgraph PathServices["PATH SERVICES"]
        AFE_R[AFE: RoboticsHandler]
        SINGLES[Singles: PackingHandler]
        BATCH[Batch: PackingHandler]
    end

    OM --> R_OM --> R_ALGO
    INV --> R_INV --> R_ALGO
    WES --> R_WES --> R_ALGO
    WAVE --> R_WAVE --> R_ALGO

    WL --> O_WL --> O_CAP
    TRACK --> O_TRACK --> O_CAP
    ROBOT --> O_ROBOT --> O_CAP
    ROBOT --> AFE_R

    PACK --> SINGLES
    PACK --> BATCH

    R_ALGO -->|ShipmentRoutedEvent| OUTPUT[Published Events]
    O_CAP -->|CapacityChangedEvent| OUTPUT

Event Sources

Source Context Topic Consuming Service Purpose
Order Management fulfillment.order_management.v1.events routing-service Order release and cancellation
Inventory Service fulfillment.inventory.v1.events routing-service Allocation and shortage events
WES Orchestration wes.orchestration.v1.events routing-service Work release and circuit breaker state
Wave Planning fulfillment.wave.v1.events routing-service Wave release and cancellation
Workload Planning workload.planning.v1.events orchestration-service Capacity forecasts and labor
Physical Tracking tracking.v1.events orchestration-service Location updates and anomalies
Robotics Fleet robotics.fleet.v1.events orchestration-service, afe-service Robot task completion
Pack & Ship wes.pack.v1.events singles-service, batch-service Packing completion

Order Management Events

OrderReleasedToWarehouseEvent

Description: Triggers path selection for a new shipment.

Topic: fulfillment.order_management.v1.events

Handler: process-path-routing-service/src/main/java/com/paklog/wms/processpath/routing/infrastructure/messaging/handler/OrderReleasedHandler.java

Action: Initiate path assignment algorithm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  "specversion": "1.0",
  "type": "com.paklog.order.released.v1",
  "source": "/order-management-service",
  "id": "evt-order-123456",
  "time": "2025-01-20T09:55:00.000Z",
  "datacontenttype": "application/json",
  "subject": "ORD-789012",
  "data": {
    "orderId": "ORD-789012",
    "shipmentId": "SHP-123456",
    "orderType": "STANDARD",
    "slaCutoffTime": "2025-01-20T16:00:00Z",
    "promisedDeliveryDate": "2025-01-21",
    "lineItems": [
      {
        "lineItemId": "LI-001",
        "sku": "SKU-WIDGET-001",
        "quantity": 2,
        "locationHint": "ZONE-A"
      },
      {
        "lineItemId": "LI-002",
        "sku": "SKU-GADGET-002",
        "quantity": 1,
        "locationHint": "ZONE-B"
      }
    ],
    "shipmentProperties": {
      "totalWeight": 3.5,
      "estimatedDimensions": {
        "length": 12,
        "width": 8,
        "height": 6
      },
      "hasHazmat": false,
      "requiresGiftWrap": false,
      "hasFragileItems": true,
      "requiresSignature": false
    },
    "carrierPreference": "UPS_GROUND",
    "customerTier": "PRIME",
    "releasedAt": "2025-01-20T09:55:00Z"
  }
}

Processing Logic:

  1. Extract shipment properties for path eligibility
  2. Analyze order composition (single/multi-item)
  3. Calculate SLA priority based on cutoff time
  4. Query current path capacity
  5. Execute path assignment algorithm
  6. Publish ShipmentRoutedToPathEvent

OrderCancelledEvent

Description: Triggers cleanup of routing and queue entries.

Topic: fulfillment.order_management.v1.events

Handler: process-path-routing-service/src/main/java/com/paklog/wms/processpath/routing/infrastructure/messaging/handler/OrderCancelledHandler.java

Action: Remove shipment from path queues, release buffer reservations

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "specversion": "1.0",
  "type": "com.paklog.order.cancelled.v1",
  "source": "/order-management-service",
  "id": "evt-cancel-123456",
  "time": "2025-01-20T10:30:00.000Z",
  "subject": "ORD-789012",
  "data": {
    "orderId": "ORD-789012",
    "shipmentId": "SHP-123456",
    "cancellationReason": "CUSTOMER_REQUEST",
    "cancelledAt": "2025-01-20T10:30:00Z"
  }
}

Inventory Service Events

InventoryAllocatedEvent

Description: Provides item properties for routing decisions.

Topic: fulfillment.inventory.v1.events

Handler: process-path-routing-service/src/main/java/com/paklog/wms/processpath/routing/infrastructure/messaging/handler/InventoryAllocatedHandler.java

Action: Enrich shipment with item properties, validate path eligibility

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
  "specversion": "1.0",
  "type": "com.paklog.inventory.allocated.v1",
  "source": "/inventory-service",
  "id": "evt-alloc-123456",
  "time": "2025-01-20T09:56:00.000Z",
  "subject": "SHP-123456",
  "data": {
    "shipmentId": "SHP-123456",
    "orderId": "ORD-789012",
    "allocations": [
      {
        "sku": "SKU-WIDGET-001",
        "quantity": 2,
        "warehouseLocation": {
          "warehouse": "WH-001",
          "zone": "ZONE-A",
          "aisle": "A-12",
          "bay": "B-03",
          "shelf": "S-02",
          "bin": "BIN-045"
        },
        "itemProperties": {
          "weight": 1.2,
          "dimensions": {
            "length": 6,
            "width": 4,
            "height": 3
          },
          "fragilityLevel": "FRAGILE",
          "sortabilityClass": "SORTABLE",
          "hazmatClass": null,
          "temperatureRequirement": null
        },
        "lotNumber": "LOT-2025-001",
        "expirationDate": null
      },
      {
        "sku": "SKU-GADGET-002",
        "quantity": 1,
        "warehouseLocation": {
          "warehouse": "WH-001",
          "zone": "ZONE-B",
          "aisle": "B-05",
          "bay": "B-12",
          "shelf": "S-01",
          "bin": "BIN-078"
        },
        "itemProperties": {
          "weight": 0.8,
          "dimensions": {
            "length": 4,
            "width": 3,
            "height": 2
          },
          "fragilityLevel": "STANDARD",
          "sortabilityClass": "SORTABLE",
          "hazmatClass": null,
          "temperatureRequirement": null
        }
      }
    ],
    "totalAllocatedQuantity": 3,
    "allocationCompleteAt": "2025-01-20T09:56:00Z"
  }
}

Path Eligibility Rules Applied:


WES Orchestration Events

WorkReleaseAuthorizedEvent

Description: Signals capacity for batch work release.

Topic: wes.orchestration.v1.events

Handler: process-path-routing-service/src/main/java/com/paklog/wms/processpath/routing/infrastructure/messaging/handler/WorkReleaseAuthorizedHandler.java

Action: Update capacity snapshot, trigger routing for batch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "specversion": "1.0",
  "type": "com.paklog.wes.work.release.v1",
  "source": "/wes-orchestration-engine",
  "id": "evt-release-123456",
  "time": "2025-01-20T10:00:00.000Z",
  "data": {
    "batchId": "BATCH-2025-01-20-001",
    "shipmentIds": ["SHP-001", "SHP-002", "SHP-003"],
    "releaseStrategy": "WAVELESS",
    "capacitySnapshot": {
      "singlesUtilization": 65,
      "singlesActiveStations": 12,
      "afeUtilization": 78,
      "afeActiveStations": 8,
      "batchFlowUtilization": 45,
      "batchFlowActiveStations": 4
    },
    "laborAvailability": {
      "pickers": 25,
      "packers": 18,
      "rebinners": 12,
      "inductors": 6
    },
    "releasedAt": "2025-01-20T10:00:00Z"
  }
}

CircuitBreakerStateChangedEvent

Description: Signals downstream service health changes.

Topic: wes.orchestration.v1.events

Handler: process-path-routing-service/src/main/java/com/paklog/wms/processpath/routing/infrastructure/messaging/handler/CircuitBreakerHandler.java

Action: Adjust routing to avoid unhealthy services

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "specversion": "1.0",
  "type": "com.paklog.wes.circuit.state.v1",
  "source": "/wes-orchestration-engine",
  "id": "evt-circuit-123456",
  "time": "2025-01-20T10:15:00.000Z",
  "data": {
    "serviceName": "pack-ship-service",
    "serviceId": "PACK-SHIP-01",
    "previousState": "CLOSED",
    "currentState": "OPEN",
    "failureRate": 45.5,
    "failureThreshold": 40.0,
    "lastFailureReason": "TIMEOUT",
    "impactedPaths": ["SINGLES", "AFE"],
    "estimatedRecoveryTime": "PT5M",
    "stateChangedAt": "2025-01-20T10:15:00Z"
  }
}

Circuit Breaker Actions:

stateDiagram-v2
    [*] --> CLOSED

    CLOSED --> OPEN: failure_rate >= threshold
    OPEN --> HALF_OPEN: timeout_elapsed
    HALF_OPEN --> CLOSED: test_requests_succeed
    HALF_OPEN --> OPEN: test_requests_fail

    CLOSED: ✅ Normal Routing
    CLOSED: All paths available

    OPEN: 🛑 Stop Routing
    OPEN: Affected paths blocked
    OPEN: Wait for recovery

    HALF_OPEN: 🔄 Testing
    HALF_OPEN: Limited traffic
    HALF_OPEN: Evaluating health

Wave Planning Events

WaveReleasedEvent

Description: Signals wave ready for batch processing.

Topic: fulfillment.wave.v1.events

Handler: process-path-routing-service/src/main/java/com/paklog/wms/processpath/routing/infrastructure/messaging/handler/WaveReleasedHandler.java

Action: Route wave shipments to Batch/Flow path

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
  "specversion": "1.0",
  "type": "com.paklog.wave.released.v1",
  "source": "/wave-planning-service",
  "id": "evt-wave-123456",
  "time": "2025-01-20T10:05:00.000Z",
  "data": {
    "waveId": "WAVE-2025-01-20-001",
    "waveType": "CARRIER_CUTOFF",
    "orderCount": 50,
    "shipmentIds": ["SHP-101", "SHP-102", "SHP-103"],
    "carrierCutoff": "2025-01-20T14:00:00Z",
    "targetCarrier": "UPS",
    "targetPath": "BATCH_FLOW",
    "zoneDistribution": {
      "ZONE-A": 20,
      "ZONE-B": 18,
      "ZONE-C": 12
    },
    "estimatedPickTime": "PT45M",
    "releasedAt": "2025-01-20T10:05:00Z"
  }
}

Workload Planning Events

CapacityForecastUpdatedEvent

Description: Provides capacity predictions for proactive routing.

Topic: workload.planning.v1.events

Handler: process-path-orchestration-service/src/main/java/com/paklog/wms/processpath/orchestration/infrastructure/messaging/handler/CapacityForecastHandler.java

Action: Adjust routing weights based on predicted congestion

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  "specversion": "1.0",
  "type": "com.paklog.workload.forecast.v1",
  "source": "/workload-planning-service",
  "id": "evt-forecast-123456",
  "time": "2025-01-20T10:00:00.000Z",
  "data": {
    "forecastId": "FCST-2025-01-20-10",
    "forecastHorizon": "PT2H",
    "forecastIntervalMinutes": 30,
    "pathForecasts": [
      {
        "pathType": "SINGLES",
        "projectedUtilization": [75, 82, 88, 78],
        "laborAvailable": 15,
        "laborRequired": 18,
        "bottleneckRisk": "MEDIUM",
        "recommendedAction": "ADD_STATIONS"
      },
      {
        "pathType": "AFE",
        "projectedUtilization": [68, 72, 80, 75],
        "laborAvailable": 24,
        "laborRequired": 22,
        "bottleneckRisk": "LOW",
        "recommendedAction": null
      },
      {
        "pathType": "BATCH_FLOW",
        "projectedUtilization": [40, 55, 65, 60],
        "laborAvailable": 10,
        "laborRequired": 12,
        "bottleneckRisk": "LOW",
        "recommendedAction": null
      }
    ],
    "volumeForecast": {
      "totalUnitsExpected": 5400,
      "singleItemOrders": 2200,
      "multiItemOrders": 800
    },
    "recommendedActions": [
      "SHIFT_SINGLES_TO_AFE",
      "ACTIVATE_RESERVE_STATIONS"
    ],
    "forecastConfidence": 0.85,
    "generatedAt": "2025-01-20T10:00:00Z"
  }
}

Physical Tracking Events

ShipmentLocationUpdatedEvent

Description: Provides real-time shipment location for monitoring.

Topic: tracking.v1.events

Handler: process-path-orchestration-service/src/main/java/com/paklog/wms/processpath/orchestration/infrastructure/messaging/handler/ShipmentLocationHandler.java

Action: Update SLA tracking, detect delays, trigger rerouting if needed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "specversion": "1.0",
  "type": "com.paklog.tracking.location.v1",
  "source": "/physical-tracking-service",
  "id": "evt-location-123456",
  "time": "2025-01-20T10:10:00.000Z",
  "subject": "SHP-123456",
  "data": {
    "shipmentId": "SHP-123456",
    "toteId": "TOTE-789",
    "trayId": null,
    "currentZone": "AFE_SORTER",
    "previousZone": "AFE_INDUCT",
    "zoneEnteredAt": "2025-01-20T10:10:00Z",
    "dwellTimeSeconds": 45,
    "expectedNextZone": "REBIN_WALL_01",
    "expectedTransitTime": "PT5M",
    "conveyorSegment": "CONV-AFE-LOOP-A",
    "scanType": "RFID"
  }
}

Delay Detection Rules:


Robotics Fleet Events

RobotTaskCompletedEvent

Description: Signals robot delivery completion for pick/induct coordination.

Topic: robotics.fleet.v1.events

Handlers:

Action: Update tote arrival status, trigger next process step

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "specversion": "1.0",
  "type": "com.paklog.robotics.task.completed.v1",
  "source": "/robotics-fleet-management",
  "id": "evt-robot-123456",
  "time": "2025-01-20T10:08:00.000Z",
  "data": {
    "taskId": "TASK-2025-01-20-001234",
    "robotId": "ROBOT-AMR-015",
    "robotType": "AMR",
    "taskType": "TOTE_TRANSPORT",
    "shipmentId": "SHP-123456",
    "toteId": "TOTE-789",
    "originLocation": "PICK-ZONE-A-12",
    "deliveryLocation": "INDUCT-STATION-03",
    "taskStartedAt": "2025-01-20T10:05:00Z",
    "taskCompletedAt": "2025-01-20T10:08:00Z",
    "travelDistanceMeters": 45.5,
    "nextAvailableAt": "2025-01-20T10:10:00Z",
    "batteryLevel": 72
  }
}

PodDeliveredEvent

Description: Signals pod arrival at pick station (for robotic picking).

Topic: robotics.fleet.v1.events

Handlers:

Action: Update pick station readiness

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "specversion": "1.0",
  "type": "com.paklog.robotics.pod.delivered.v1",
  "source": "/robotics-fleet-management",
  "id": "evt-pod-123456",
  "time": "2025-01-20T10:07:00.000Z",
  "data": {
    "taskId": "TASK-POD-2025-01-20-005678",
    "robotId": "ROBOT-AGV-008",
    "podId": "POD-A-1234",
    "pickStationId": "PICK-STATION-05",
    "skusOnPod": ["SKU-WIDGET-001", "SKU-GADGET-003"],
    "pendingPicks": 5,
    "deliveredAt": "2025-01-20T10:07:00Z"
  }
}

Event Correlation

Process Path correlates events using these identifiers:

Identifier Scope Used By
shipmentId Primary All events related to a shipment
orderId Order scope Linking shipments to orders
toteId Physical tracking Correlating physical movements
trayId AFE operations Tracking items in AFE system
batchId Wave/batch scope Grouping related shipments
waveId Wave planning Wave execution tracking

Event Processing SLAs

Event Type Max Processing Time Action on Timeout
OrderReleasedToWarehouseEvent 500ms Retry + Alert
InventoryAllocatedEvent 200ms Retry
CircuitBreakerStateChangedEvent 100ms Immediate action
ShipmentLocationUpdatedEvent 100ms Log + Continue
RobotTaskCompletedEvent 200ms Retry