ValidateIncomingCategory
Changed on:
30 Nov 2023
Overview
Validates the incoming category event
Plugin Name | Inventory Reference Module |
---|---|
Namespace | [[account.id]].globalinventory |
The Inventory Reference Module is the foundation for inventory 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 Inventory 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 rule.
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 | [Attribute] | 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}
Language: json
Detailed Technical Description
All the event attributes of the incoming event must conform to the following JSON structure and are parsed/deserialized into a "Category" object which has the following structure.
A sample event 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}
Language: json
Name: Category JSON
Description:
[Warning: empty required content area]The below snippet shows the corresponding Java class definition of the incoming event's event 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}
Language: java
Name: Category Java Class Definition
Description:
[Warning: empty required content area]The only thing this rule checks is if the event attributes could be deserialized to the Category object properly. It validates the attributes and throws the exceptions detailed in the Exceptions section. Otherwise, the rule does not have any output actions.
Version History
v2.0.0
refers to plugin