Expired Products
ExpiredProductRule
Highlight and replace expired products.
Notification level: ⚠
Key | Value |
---|---|
ID | ExpiredProductsRule |
Translation key | expired_products_rule.title expired_products_rule.error_message |
Behavior
The Kitchen planner handles natively expired products with some basic behaviors. You can find more details in the expired products documentation 🔗.
This applicative rule adds two additional features to help users deal with expired products in their projects. These two actions are available in the help center:
- highlight the expired products in the scene
- replace the expired products by available products
Every time the BOM is computed, the expired products, sub-products and linears are listed based on their start-date and end-date. This list is then used by the applicative rule to determine the actions allowed for the user.
📌 Note: if the rule is not implemented, nothing of the following documentation applies in the planner, but users still benefit from the native support of expired products (see above link).
Trigger Conditions
The rule is triggered if there is at least one "eligible" expired product in the BOM. Below is the list of eligible expired products:
- Top product (Also referred as root product in this documentation)
- For generic products, the rule verifies both the generic and the resolved product
- Sub product (i.e. part of the top-product assembly)
- For generic products, the rule verifies both the generic and the resolved product
- Linear (i.e. worktop, wall-panel, wall-edge-strip, plinth, cornice and deco-strip)
Everything else is non-eligible, meaning that they will not result in a card in the Help Center if they are expired. Notably:
- Additional BOM product : products that are added in the BOM by a BOM applicative rule (such as the rail-fittings rule 🔗)
- Linear sub-element : everything that is in the
children
list of linear objects in the BOM, such as operations, boards, etc.
Highlight workflow
Depending on the current step of the application and the product type, the action for highlighting the expired product changes.
In 3D view
Product type | Highlight action |
---|---|
Top product | show in 3D : highlights the product(s) with a red 3D bounding box |
Sub product editable via a parameter | show in 3D : highlights the top-product(s) in which the sub-product is located with a red 3D bounding box |
Sub product not editable via a parameter | None |
Linear | None |
In 2D view
Product type | Highlight action |
---|---|
Top product | show in 2D : highlights the product(s) with a red 2D bounding box |
Sub product editable via a parameter | show in 2D : highlights the top-product(s) in which the sub-product is located with a red 2D bounding box |
Sub product not editable via a parameter | None |
Linear | None |
In the cabinet editor
Product type | Highlight action |
---|---|
Sub product | show in 3D : highlights the sub-product itself with a red 3D bounding box |
Replace workflow
The action for replacing expired products also depends on the current step of the application and the product type. Below is a chart that shows the replace action in colored rectangles (green rectangle for the main application, purple rectangle for the cabinet editor). It also shows how the replace mechanism is handled depending on the rule overloads (see the Overload Parameter section below).
📌 Note: In this chart,
root product
means either a top-product, or a linear.
Overload Parameter
Key name | Type | Default value | Description |
---|---|---|---|
replacements | object | – | A mapping table with a replacement product ID for each expired product ID. Mandatory key but can be empty. |
📌 Note: the rule overloads are used to define what we call predefined replacements, but these are optional. Implementing the rule with an empty replacement list still offers highlight and replace mecanisms as described above. Predefined replacements are used if you want to suggest a particular replacement for an expired product, and that will display a specific pop-in in the planner.
For example: In the sample code below, 9555 is the expired product and 9194 is the replacement product.
{
"replacements": {
"9555":"9194",
"9856":"9217",
"13461":"10370"
}
}
Example use cases
The following examples show how to deal with expired products in the application.
1 - expired top product
For this example, the cabinet CAB_800 is expired and the user's kitchen contains 3 occurences of this cabinet.
- Open the Help center and check for expired products.
- Expired products are grouped by ID so there is only one card for all the expired CAB_800.
- Click Show in 3D on the card.
- The 3 CAB_800 are highlighted in red for a few seconds in the 3D scene.
- Click Replace on the card.
- If a predefined replacement is setup, a specific pop-in is displayed. Otherwise, a regular replace catalog is open.
2 - expired linear
For this example, the worktop WT_WOOD_PRECUT is expired and the user's kitchen contains 2 linears with this worktop.
- Open the Help center and check for expired products.
- Expired products are grouped by ID so there is only one card for all the expired WT_WOOD_PRECUT.
- There is no highlight button as linears are not handled.
- Click Replace on the card.
- If a predefined replacement is setup, a specific pop-in is displayed. Otherwise, a regular replace catalog is open.
3 - expired sub product, controlled via parameter
For this example, the sub-element FRONT_GREY_600 is expired and the user's kitchen contains this front on all the cabinets.
- Open the Help center and check for expired products.
- Expired products are grouped by ID so there is only one card for all the expired FRONT_GREY_600.
- Click Show in 3D on the card.
- All the cabinets that use this front are highlighted in red for a few seconds in the 3D scene. Note that the entire cabinet is highlighted, not just the front.
- Click Replace on the card.
- If a predefined replacement is setup, a specific pop-in is displayed. Otherwise, a regular replace catalog is open.
It is important that the root product's parameter is visible (i.e. it is displayed in the edit panel). If not, the replace catalog on the third step will always be empty.
4 - expired sub product, not controlled via parameter, direct child
For this example, the sub-element SHELF_BLACK_600 is expired and a cabinet contains 2 of those shelves in the user's kitchen.
Also, let's assume the 2 following points:
- shelves cannot be edited on the root product (either because the range is created in such a way, or because the cabinet was previously modified manually in the cabinet editor).
- the SHELF_BLACK_600 product is a direct child of the root product.
- Open the Help center and check for expired products.
- Note that the corresponding card only has a Replace in cabinet composer button. There is no option to highlight the element at this point.
- Click Replace in cabinet composer on the card.
- This action opens the cabinet composer for the cabinet that contains the 2 expired shelves.
- Open the Help Center in cabinet composer and check for expired products.
- Expired products are grouped by ID so there is only one card for the 2 expired SHELF_BLACK_600.
- Click Show in 3D on the card.
- The 2 shelves are highlighted in red for a few seconds in the 3D scene.
- Click Replace on the card.
- If a predefined replacement is setup, a specific pop-in is displayed. Otherwise, a regular cabinet editor replace catalog is open.
- Note that the cabinet editor replace catalog uses anchor points and the available space to define the compatible replacements.
5 - expired sub product, not controlled via parameter, not direct child
For this example, the sub-element HANDLE_INOX_01 is expired and a cabinet contains 2 of those handles in the user's kitchen.
Also, let's assume the 2 following points:
- handles cannot be edited on the root product (either because the range is created in such a way, or because the cabinet was previously modified manually in the cabinet editor).
- the HANDLE_INOX_01 product is not a direct child of the root product.
- Open the Help center and check for expired products.
- Note that the corresponding card only has a Replace in cabinet composer button. There is no option to highlight the element at this point.
- Click Replace in cabinet composer on the card.
- This action opens the cabinet composer for the cabinet that contains the 2 expired handles.
- Open the Help Center in cabinet composer and check for expired products.
- Expired products are grouped by ID so there is only one card for the 2 expired HANDLE_INOX_01.
- Click Show in 3D on the card.
- The 2 handles are highlighted in red for a few seconds in the 3D scene.
- There is no Replace button on the card.
This scenario is the main limitation of the expired products replace feature. As a result, the user is responsible to manually replace the two handles (it could be via selecting the doors and replace their handles through a parameter ; this part depends entirely on the range structure).
It is possible to avoid falling in this situation but it requires to meet one of these conditions:
- do not use the cabinet composer in your application
- never expire a sub-element
- set all the parameters on the sub-elements of your range as non-visible, so that the cabinet composer can only be used to add/remove elements that are direct children of the root product, but cannot be used to modify elements deeper that this.
Illustration
A cabinet in the design is expired, the business rule is triggered and guides the user through the actions required to replace it with another cabinet.
When available, a Show in 3D action can be used to highlight the product that is expired.
When clicking Replace, and if the rule overloads contain a replacement for the expired product, a pop-in displays a suggestion to replace it with a new one.
After replacing an expired product with an available one, the rule no longer triggers.