Skip to main content

Production Workflow

ProductionWorkflowBuilder.create(ProductionPlan) returns a TypesafeCarouselStateMachine<ProductionState>. Configure a plan with exactly one product selector (optionName or optionIndex) and exactly one quantity selector (quantity or customQuantity). build() rejects either missing pair. An optional InventoryLoadout enables the BANK_RESTOCK state.

ProductionPlan plan = ProductionPlan.builder()
.optionName("Willow longbow")
.quantity(ProductionQuantity.ALL)
.restockLoadout(loadout)
.build();

TypesafeCarouselStateMachine<ProductionWorkflowBuilder.ProductionState> machine =
ProductionWorkflowBuilder.create(plan);

Pulse the machine once per client tick. Its source-defined states are WAIT_FOR_PRODUCTION_OPEN, SELECT_OPTION, SELECT_QUANTITY, WAIT_FOR_PRODUCTION_COMPLETE, and BANK_RESTOCK. Inspect each CarouselResult or machine.snapshot() for progress and failure details. Call reset() before reusing a terminal workflow.

ProductionActions owns direct Make-X interface interactions. Keep item-on-item or other single interactions in the action layer rather than wrapping them in a production workflow.