the unique identifier for this nozzle.
Current state of the state machine. Observable property that updates automatically via @kosModel. Always initialized to the initial state immediately.
Readonly isIndicates whether the state machine has been initialized. FSM initializes at the configured lifecycle phase (READY, ACTIVATE, etc.).
false, currentState === undefinedtrue, currentState === initialIndicates whether a state transition is currently in progress. Observable property that updates during transitions.
Readonly allowedComputed array of valid events that can be triggered from the current state. Updates automatically when state changes. Returns empty array if FSM is not initialized.
Optional stateHistory of state transitions (if trackHistory is enabled). Each entry contains the state, timestamp, and optional event that caused the transition.
Only available when trackHistory: true is set in options.
Optional event?: PourEvent-------------------LIFECYCLE----------------------------
Optional brand: AvailabilityModel<any, Record<string, any>>Set the values used to determine the selected pourable for this nozzle.
The pourable to set.
Utility method that will return the availability nodes that belong to the specified group as defined in the dispenser beverage graph. For example, a dispenser implementation may group availability nodes by Brand, Beverage, or Flavors
The group to filter by.
The availability nodes that are available to be dispensed from this nozzle and are in the specified group.
Utility method that will return the availability nodes that are tagged with the specified parent id.
This is useful when brandsets use the taggedIds property to associate nodes with a parent node. For example, when organizing a brandset into brands and beverages, the brand nodes will be tagged with the beverage nodes.
The parent id to filter by.
the availability nodes that are tagged with the specified parent id.
An action that will initiate a fixed volume pour for this nozzle using the specified pourable volume name.
The invocation of this action will result in a Future being returned that will provide the status of the pour and return any errors that may occur.
Optional tracker: stringkosFuture
Trigger a state transition by event.
The event to trigger
Error if FSM not initialized (unless throwOnInvalid is false)
Error if transition is invalid (unless throwOnInvalid is false)
this.transition('START'); // idle -> active
this.transition('STOP'); // active -> idle
Check if a transition is valid from the current state. Returns false if FSM is not initialized.
The event to check
true if the transition is valid, false otherwise
if (this.canTransition('START')) {
this.transition('START');
}
Check if the state machine is currently in a specific state. Returns false if FSM is not initialized.
The state to check
true if currently in the specified state, false otherwise
if (this.isInState('idle')) {
console.log('System is idle');
}
The NozzleModel provides the availability of pourables that are associated with the nozzle.
Its primary purpose is to provide a mechanism for selecting from available pourables and initiating a pour.
It is possible for a dispenser to have multiple asymmetrical nozzles. For example, a dispenser may have a nozzle that is used for dispensing a syrups and flavors and another that is just dispensing water.
The NozzleModel is a IKosDataModel and is registered with the model registry using the Nozzle type.
See
Lifecycle
Load
During the
loadphase of the model lifecycle, the set of Availability nodes will be retrieved for the nozzle. The nodes will be indexed based on the definedgroupIdfor the node. ThegroupIdis defined in the dispenser beverage graph and is used to group availability nodes.Extension Points
The
loadlifecycle hook will first call into the ExtensionType.AvailabilityLoader extension point in order to establish the context that will be used to populate the availability nodes.The
loadlifecycle hook will then call into the ExtensionType.AvailabilityMapper for each Availability node that is retrieved. The extension point will be called the the Availability context data and the NozzleServices.BeverageResponse for the availability node.