ValidateIncomingCategory
Changed on:
30 Nov 2023
Overview
Validates the incoming category
Plugin Name | Inventory Reference Module |
---|---|
Namespace | [[account.id]].globalinventory |
The is the foundation for related implementations. It provides reference Workflows for inventory ingestion and processing. Extensible by design, use this Module as a base to build a solution to the needs of your customers.
The Module includes the following areas:
- Product Catalogue workflow
- Inventory Catalogue workflow
- Control Group workflow
- Virtual Catalogue workflow
UI Description
Validates the incoming category event
Accepts
- PRODUCT_CATALOGUE
Actions
- This rule does not produce any output actions. It reads all the incoming event attributes to confirm that they can be converted to the expected format.
Rule parameters
There are no Input Parameters for this .
Event attributes
Parameter | Description | Data Type | Required? |
ref | The unique reference of the category | String | Required |
type | The type of the category | String | Optional |
name | The name of the category | String | Optional |
summary | The summary of this category | String | Optional |
parentCategory | The parent category ref if this category has a parent category | String | Optional |
childCategories | A list of child category references if this product has child categories | [String] | Optional |
attributes | Additional attributes of this category | [] | Optional |
Exceptions
- If the event attributes are not conformed to the Category object outlined above an IllegalArgumentException will be thrown.
- If event attribute {ref} is missing or empty, EventAttributeNotFoundException will be thrown.
Configuration example
1{
2 "name": "{{ACCOUNTID}}.globalinventory.ValidateIncomingCategory"
3}
Detailed Technical Description
All the attributes of the incoming must conform to the following JSON structure and are parsed/deserialized into a "Category" object which has the following structure.
A sample attributes payload with example values:
1{
2 "ref": "INFT_1",
3 "type": "STANDARD",
4 "attributes": [],
5 "name": "Infants Toys",
6 "summary": "summary",
7 "parentCategory": "parent_category",
8 "childCategories": [
9 "child_category_1",
10 "child_category_2"
11 ]
12}
The below snippet shows the corresponding Java class definition of the incoming 's attributes
1public class Category {
2
3 @NonNull
4 private String ref;
5
6 private String type;
7
8 private List<Attribute> attributes;
9
10 private String name;
11
12 private String summary;
13
14 private String parentCategory;
15
16 private List<String> childCategories;
17}
The only thing this checks is if the attributes could be deserialized to the Category object properly. It validates the attributes and throws the exceptions detailed in the Exceptions section. Otherwise, the does not have any output actions.
Version History
v2.0.0
refers to