Allowed and available components
During the configuration process, each component may be one of the several states:
Not allowed
Allowed but not available
Allowed and available
These states can be summarized:
State | Description |
|---|---|
Not allowed | A component is blocked by one or more rules. Typical handling in the user experience:
|
Allowed but not available | A component is generally allowed however it is not in stock, does not have inventory, or otherwise purchaseable. Typical handling in the user experience:
|
Allowed and available | A component can be selected Typical handling in the user experience:
|
Controller handling
When using the Javascript API, the controller class automatically performs state and availability calculations. Developers can enhance the out of the box functionality by handling events:
isAllowed— perform additional component validations. Note that the standard functionality, such as rules calculations, always apply and cannot be disabledisAvailable— perform component inventory or stock validation. If the event handler returnstrue, the out of the box inventory validation still will apply.getInventory— return an available inventory for a component.