DemandForwarder

constructor(parent: ModelElement, upstreamSupplier: () -> DemandFillerIfc?, sender: DemandSenderIfc, onUpstreamDelivered: (original: SupplyChainModel.Demand) -> Unit? = null, shouldFillOnReceive: (DemandFillerIfc) -> Boolean = { true }, name: String? = null)(source)

Parameters

parent

the model element that owns this forwarder (typically the routing node it's attached to)

upstreamSupplier

resolves the upstream filler at call time, so callers can configure the upstream after construction (the typical pattern when a node's demandFiller is set by network attachment)

sender

the DemandSenderIfc to stamp on the forwarded request — typically the routing node so the upstream knows where to return the delivery

onUpstreamDelivered

optional callback fired when the upstream delivers the forwarded request; receives the original demand that was forwarded. Leave null when a receiving-dock mechanism will handle finalisation.

shouldFillOnReceive

predicate that gates whether to ask the upstream to fillDemand on RECEIVED. Defaults to always true; pass a predicate returning false for upstreams that drive their own fill cycle.

name

optional model-element name