ValidateCategoriesExist
RuleRules are designed to be building blocks for workflow logic.
Changed on:
12 Aug 2025
Overview
Validates the incoming category event for the existence of the parent and child categories| Plugin Name | Inventory Reference Module |
|---|---|
| Namespace | [[account.id]].globalinventory |
- Product Catalogue workflow
- Inventory Catalogue workflow
- Control Group workflow
- Virtual Catalogue workflow
UI Description
Validates the incoming category event for the existence of the parent and child categories
Accepts
- PRODUCT_CATALOGUE
Actions
- This rule does not produce any output actions. It validates the incoming child categories and the parent category if they exist. Otherwise, an IllegalArgumentException will be thrown with the missing categories
Rule parameters
There are no Input Parameters for this rule.
Event attributes
| Parameter | Description | Data Type | Required? |
| childCategories | A list of child categories of the category being created/updated. Each child category is a string and the value of this field is a list of strings | [String] | Optional |
| parentCategory | The category reference if the current category being created/updated has a parent category | String | Optional |
Exceptions
- If there is a parent category provided in the incoming event and if it does not exist, an IllegalArgumentException will be thrown.
- If there are one or more child categories provided in the incoming event and if at least one of them does not exist, an IllegalArgumentException will be thrown
Configuration example
1{
2 "name": "{{accountId}}.globalinventory.ValidateCategoriesExist"
3}Detailed Technical Description
The below snippet shows the corresponding Java class definition of the incoming event's event attributesThis rule parses/deserialises all the event attributes into a Category object outlined above. If child categories are present in the event attributes, it will perform a validation on them. The rule will throw an exception with all the missing categories if the provided child category/categories do not exist. Likewise, the rule performs the same validation on the parent category if such value is present in the event attributes and throws an exception if the parent category does not exist. Otherwise, the rule does not have any output/output action. Note that a parent category ref with an empty string or series of empty spaces is considered a valid parent category.