Demand
A demand for a quantity of an ItemType. Flows through the supply chain via a state machine; see DemandState. Listeners can be attached to react to state transitions.
Created only via SupplyChainModel.createDemand.
See sc.inventorylayer.Demand
Properties
Whether this demand can be backlogged when not immediately filled.
Whether the demand can be cancelled after receipt.
Whether partial filling is permitted.
Quantity supplied so far against this demand.
The sender of this demand. Named demandSender (not sender) to avoid hiding QObject.sender, which is the station-layer ksl.modeling.station.QObjectSenderIfc.
Current state. Starts at inPreparation.
The filler that this demand was committed to.
The original demand this one was forwarded from, if any. Set by ksl.modeling.supplychain.flow.DemandForwarder and routing nodes (cross-docks) that forward a request upstream: the forwarder sends a forwarded request upstream while parking the original in IN_PROCESS; when the forwarded request returns delivered, the receiving endpoint reads this property to recover the typed original and fill it.
True once the entire originalAmountDemanded has been supplied.
True iff this demand is part of an order.
The order this demand is attached to, or null.
The line index within order.
The original quantity requested when the demand was created.
Most recent prior state, or null on creation.
The filler that actually received the demand.
Quantity not yet filled. Reaches 0 when the demand is filled.
Outcome status. See DemandStatusCode.
Rolling total demand seen by the filler when this demand arrived.
Functions
Register a listener that fires exactly once — on the first transition to targetState — and then removes itself. The action runs inside a try/finally so the listener is unregistered even if action throws.
Register a listener.
True iff previousDemandState === state.
True iff demandState === state.
Attach observer to this demand. Returns the underlying DemandStateChangeListener so callers can remove the subscription later via SupplyChainModel.Demand.removeStateChangeListener.
Accept this demand and start processing it: transitions it through RECEIVED → IN_PROCESS at receiver. Equivalent to the two-call sequence receive(receiver); process(receiver) but named for the intent ("the receiver has taken the demand and is now responsible for finishing it").
Unregister a listener.