Skip to main content

Cartonization: how a plan is made

What this shows. The steps from "Release" or "Allocate" on an order to a saved carton plan, and how the plan reaches the pickers.

There is no button and no RPC for cartonization. It runs inside the reserve command. If it fails, the reservation stays and the command result carries the error text.

What the steps mean​

StepWhat happens
SavepointThe whole attempt is nested in the reserve transaction. A failure undoes only the plan, not the reservation.
Read reservationOnly picks with status Allocated or Released are read. A pick quantity becomes whole units of the pick's pack level.
Bypassed picksA pick skips the solver when its pack level is unknown, is a factory package, is not cartonized, or no policy resolves. See 11.
Input hashAfter release, if the hash of the input equals the live plan, nothing is rewritten.
After releaseThe engine plans only the new work around boxes that already stand. Before release it makes a full new plan.
WritePlan status is Planned, or PlannedWithExceptions if any unit is unplaced. A pick that spans two cartons is split into two pick rows.
TasksOnly picks whose outcome is Planned, ShipAsIs or Bypassed get a task. Pending and Blocked get none. Tasks are created only when the order is released.

Plans are also marked after other commands: Unallocate and Delete Selected (picks) call plan_lost_its_work, which sets the live plan to Superseded or Stale.

Where it comes from​

ClaimSource
Release runs the same reserve body as Allocatecrates/libs/wms-outbound/src/service/order/release.rs:371
Reserve calls cartonization, then makes taskscrates/libs/wms-outbound/src/service/order/allocate.rs:398
Tasks only when the order is releasedcrates/libs/wms-outbound/src/service/order/allocate.rs:408
Only executable outcomes get taskscrates/libs/wms-outbound/src/service/order/allocate.rs:418
The result carries the plan or the errorcrates/libs/wms-outbound/src/service/order/allocate.rs:447
Savepoint wrapper, error becomes textcrates/libs/wms-outbound/src/cartonization/ensure.rs:455
Failure does not cancel the reservationcrates/libs/wms-outbound/src/cartonization/ensure.rs:507
Plan steps: read, solve, hash, validate, supersede, writecrates/libs/wms-outbound/src/cartonization/ensure.rs:112
Same hash after release means no rewritecrates/libs/wms-outbound/src/cartonization/ensure.rs:194
Old plan becomes Superseded before the writecrates/libs/wms-outbound/src/cartonization/ensure.rs:227
Unplaced units give PlannedWithExceptionscrates/libs/wms-outbound/src/cartonization/write.rs:142
Bypassed picks get their outcomecrates/libs/wms-outbound/src/cartonization/write.rs:217
Pick tasks per outcomecrates/libs/wms-outbound/src/cartonization/handoff.rs:27
Reserved picks read (Allocated, Released)crates/libs/wms-outbound/src/cartonization/read_from_db.rs:140
Lost work marks the plancrates/libs/wms-outbound/src/cartonization/ensure.rs:322