Automation Documentation
Automation
Introduction
There are many use cases when product data must be validated, cleaned, enriched etc. in automated way based on a customer/user needs.
Today, most of the customers have to do this tasks manually or they did coded customization (not changeable by a customer via UI, not maintainable, problematic for easy upgrades of the software). The users, admins or partners spend a lot of efforts and time into coding rules and actions manually (e.g. using Script Runner, Bulk Actions, Save Event, manual work). In the worst case they export and re-import product data to clean up and validate it externally.
Customer want to define such kind of automation in easy and flexible way inside of PIM. Therefore, we add a new module into PIM which allows users to set up and maintain automated validation, enrichment and cleansing in PIM in an easy and comfortable way.
Goals of the Automation
- validate product information in an automated process and get a report or notification
- help to notify users or coworkers about bad data and needed manual enrichment, changes or approvals
- change product information data based on rules to auto-correct errors, enrich data or create cross-references
- measure quality of their data (completeness, missing data, level of enrichment, in general or also per sales channel)
- provide predefined conditions and actions to define automated data improvements
- make automation reusable in multiple places, e.g. editing process as well as in a bulk operation
- make easy for users/admins to add additional rules and use different actions
Solution Summary
- The Automation is organized in Rules Lists.
- Each Rule List contains the list of Rules.
- A Rule is defined as a kind of if-then-statement. It contains a Condition (If) and list of Actions (Then) which are performed if the Condition was met.
- A Rule List is run by user or triggered by events in the system.
- Depending on the Rule the Actions may update the product or notify users (e.g. via email or notification on UI).
- The Automation works on one product at a time, not working on other products or updating them.
Examples for a Rule used in Automation:
If required attributes in a product are empty
then set product status to “edit”
If width, length and height exist
then calculate volume
User story
- A User can create or update Rule List with necessary Rules. Each Rule contains a Condition and list of Actions.
- A User can search the products and select the Rule List to execute it immediately or schedule when it shall run.
Conditions
This list gives an overview on the available conditions.
Condition | Description |
---|---|
Always true | Always matches any product so that actions are performed on it Class: AlwaysTrue |
Attributes values are missing | Checks if product doesn't have values or all values are empty for specified Attributes NOTE: It doesn't check if multi-language Attribute value is missed for the Language, use Translations are missing condition to check that Attributes don't have values for Languages. Class: AttributesAreMissing Parameters
ResultThe involvedObject field of condition contains attributes that don't have values or all values are empty for them. This attributes can be used in Actions. For example, Add Attribute Value for missing Attributes and Set Attribute Value Status actions use attributes stored in the condition result to modify the product attributes' values for these attributes only. Also, these attributes can be referenced in such actions as Send Email and Write To Log File by using Freemarker expressions. |
Attributes values contain string | Checks if product has attribute values for specified Attributes which contain at least one of specified Strings Class: AttributeContainsString Parameters
ResultThe involvedObject field of condition evaluation result contains a map with a key corresponding to the attribute object and value - to the set of strings, that attribute value contains respectively. This map can be referenced in such actions as Send Email and Write To Log File by using Freemarker expressions. |
Attribute Value has invalid chars | Checks if any of the values of the selected products attributes has any of the invalid chars. Parameters
|
Classified in Classification | Checks if the product is assigned to at least one of the Classification Groups of the given Classification |
Classification assignment is missing | Checks if product is not assigned to any group from specified Classification Class: ClassificationAssignmentIsMissing Parameters
|
Data violates the type definitions | Checks if there are violations in attribute values and compatibility attribute values
Class: DataTypeViolations ResultThe list of violations is stored in involvedObject field of condition evaluation result, these violations can be referenced in such actions as Send Email and Write To Log File. |
Document assignments are missing | Checks if product doesn't have assignments to document at least for one of with specified View Types Checks if the product doesn't have assignments to at least for one document with specified View Types. Class: DocumentsAreMissing Parameters
ResultThe involvedObject field of condition evaluation result contains a map with:
These view types can be referenced in such actions as Send Email and Write To Log File by using expressions. |
Prices are missing | Checks if a product doesn't have prices of a given type in a given contract. Checking prices is useful to check data completeness and data quality inside PIM. If the product doesn't have prices of a given type in a given contract than all its variants will be checked: all of them should have certain prices. |
Product is assigned to Classification Group | Checks if the product is assigned to specified Classification Group |
Product header information is missing | Checks if at least one of the specified product's Fields is missing Class: ProductHeaderInfosMissing Parameters
ResultThe involvedObject field of condition evaluation result contains the set of fields' names for which there are not value. These fields' names can be referenced in such actions as Send Email and Write To Log File by using expressions. |
Product Status is | Checks if product is in specified Status Class: ProductStatusIs Parameters
|
Product Status is in range of | Checks if product is in specified Statuses Range Class: ProductStatusIsInRange Parameters
NOTE: both, from and to, can be empty, it means that any status is allowed, practically it means that any product matches the condition |
Referenced data is missing | Checks if product contains data which references other objects which do not exist in system Master Data (Product)
Classifications (Product2ClassificationGroup)
Attributes (AttributeValue)
Documents (ProductDocAssociation)
Prices (Price)
Assortments (ContractedProduct)
Relations (ProductRelation, direct and reverse)
Variants (Variant)
Compatibilities
Class: ReferencedDataIsMissing Parameters
ResultThe involvedObject field of condition evaluation result contains the map of missed references. This map can be referenced in such actions as Send Email and Write To Log File by using expressions. |
Relation to Product or Group exists | Checks if the product has or doesn't have a Relation to other products or Classification Group. In case several fields of Relation Types need to be checked it has 'AND' logical operator: all conditions for Product should match. |
Required Attribute Values are missing | Checks if the product is
Composite attributes and their nested attributes are not checked. |
Translations are missing | Checks if the product doesn't have values or all values are empty for at least one combination of attribute and language for specified Attributes and Languages. NOTE: This condition is similar to Attributes values are missing but also takes into account specified Languages. Class: TranslationsAreMissing Parameters
ResultinvolvedObject field of condition evaluation result contains a map with a key which refers to an attribute, and a value - to a set of languages for which there are not values or all values are empty. This values can be used in Actions. For example, Add Attribute Value for missing Attributes and Set Attribute Value Status actions use this map stored in the condition result to modify the product attributes' values for the attributes and languages in the map. Also, these attributes can be referenced in such actions as Send Email and Write To Log File by using expressions. |
Translations contain string | Checks if product has attribute values for specific Languages which contain at least one of specified Strings. |
Actions
This list shows available actions.
Action | Description |
---|---|
Add Attribute Value | Adds the Value to Product Attribute Value for specified Attribute and Language if value is empty If Attribute Value exists and Value is empty then just sets Value. Supports Freemarker expression in the Value parameter, so it is possible to calculate Value based on the product data. <#-- calculate the area --> ${(attributeValues['MC_Depth']!0) * (attributeValues['MC_Width']!0) * (attributeValues['MC_Height']!0)} <#-- calculate new value based on other attributeValue --> ${(attributeValues['MC_Width']!0) + (involvedObject?size)} ${rules[1].conditionResult.involvedObject[0]} Class: AddAttributeValue Parameters
|
Add Attribute Value for missing Attributes | Adds the Value to Product Attribute Value for the missed attributes and specified Language This action only works if Attributes values are missing or Translations are missing condition is used in the Rule, the action uses the missed attributes collected by those conditions to add specified Value. Supports Freemarker expression in the Value parameter, so it is possible to calculate Value based on the product data. <#-- calculate the area --> ${(attributeValues['MC_Depth']!0) * (attributeValues['MC_Width']!0) * (attributeValues['MC_Height']!0)} <#-- calculate new value based on other attributeValue --> ${(attributeValues['MC_Width']!0) + (involvedObject?size)} ${rules[1].conditionResult.involvedObject[0]} Class: AddAttributeValueForMissingAttributes Parameters
|
Add Translation | Adds Value to Product Attribute Value for specified Attribute and Language if value is empty. If Attribute Value exists and Value is empty then just sets Value. Supports Freemarker expression in the Value parameter, so it is possible to calculate Value based on the product data. <#-- calculate the area --> ${(attributeValues['MC_Depth']!0) * (attributeValues['MC_Width']!0) * (attributeValues['MC_Height']!0)} <#-- calculate new value based on other attributeValue --> ${(attributeValues['MC_Width']!0) + (involvedObject?size)} ${rules[1].conditionResult.involvedObject[0]} Class: AddTranslation Parameters
|
Assign Classification Group | Assigns the specified Classification Group to product if assignment doesn't exist Class: AssignClassificationGroup Parameters
|
Assign Classification Group through Mapping | Assigns Classification Group to product by using specified Classification Group Mapping Practically if the product has a group that is a source group in a mapping, then a target group is assigned if it is not assigned to a product. See also value-mapping. Class: AssignClassificationGroupByMapping Parameters
|
Delete Attribute Values | Deletes the Product Attribute Values for specified Attributes If Attribute is multi-valued the old list of values will be fully deleted. Class: DeleteAttributeValues Parameters
|
Delete Document Associations | Deletes the Document Associations for a list of products in the scope of the given View Types, Status and Languages Class: DeleteDocumentAssociations Parameters
|
Delete Prodct Relations | Delete Product Relations of a given Type and optional Status. Class: DeleteProductRelations Parameters
|
Delete Translation | Deletes the Product Attribute Values for the defined Attributes in the scope of the given Languages If Attribute is multi-valued the old list of values will be fully deleted. Class: DeleteTranslations Parameters
|
Replace Attribute IDs using a Mapping | Replaces product Attribute IDs by using specified Attribute Mapping. Practically if the product has an attribute that is a source attribute ID in a mapping, then the current attribute ID is replaced by target attribute ID. See also value-mapping. Class: ReplaceAttributeIdByMapping Parameters
|
Replace Classification Group through Mapping | Replaces Classification Group product assignments by using specified Classification Group Mapping Practically if the product has a group that is a source group in a mapping, then the current group is removed and a target group is assigned if it is not assigned to a product. See also value-mapping. Class: ReplaceClassificationGroupByMapping Parameters
|
Replace Units of Measure using a Mapping | Replaces product Units of Measure by using specified Value Mapping. Practically if the product has a value that is a source unit type value ID in a mapping, then the current value is replaced by target unit type value ID. See also value-mapping. Class: ReplaceUnitOfMeasureByMapping Parameters
Unit types
|
Send Email | Sends email to specified recipient (To) with specified subject (With Subject) and message (With Message). The subject and message support Freemarker expressions to access the product data. For example, if it is necessary to mention the Product's ID then use ${product.productId} in subject (With Subject) or message (With Message). Class: SendEmail <#if rules[0].conditionResult.success> <li> attributes are missing: <#list rules[0].conditionResult.involvedObject as attribute> - ${attribute} </#list> </#if> Parameters
|
Set Attribute Value Status | Sets the specified status to Product Attribute Value for the missed attributes and specified Language This action only works if Attributes values are missing or Translations are missing condition is used in the Rule. The action uses the missed attributes collected by those conditions to set the specified status (To Status). Class: SetAttributeValueStatus Parameters
|
Set Translation Status | Sets the specified status (To Status) to Product Attribute Value for the specified Attributes and Languages. Class: SetTranslationStatus Parameters
|
Update Product Status | Updates the product's status to the specified one Class: UpdateStatus Parameters
|
Update Attribute Value | Updates Value of Product Attribute Value for specified Attribute. Supports Freemarker expression in the Value parameter, so it is possible to calculate Value based on the product data. <#-- calculate the area --> ${(attributeValues['MC_Depth']!0) * (attributeValues['MC_Width']!0) * (attributeValues['MC_Height']!0)} <#-- calculate new value based on other attributeValue --> ${(attributeValues['MC_Width']!0) + (involvedObject?size)} ${rules[1].conditionResult.involvedObject[0]} Class: UpdateAttributeValue Parameters
|
Update Attribute Value using a Mapping | Updates product Attribute value by using specified Value Mapping for specified Attributes. Practically if the product has a value that is a source value in a mapping, then the current attribute value is updated by target attribute value. See also value-mapping. Class: UpdateAttributeValueByMapping Parameters
|
Update Product Status | Updates the product's status to the specified one (To parameter). Class: UpdateStatus Parameters
|
Update Translation | Updates Value of Product Attribute Value for specified Attribute and Language. Supports Freemarker expression in the Value parameter, so it is possible to calculate Value based on the product data. <#-- calculate the area --> ${(attributeValues['MC_Depth']!0) * (attributeValues['MC_Width']!0) * (attributeValues['MC_Height']!0)} <#-- calculate new value based on other attributeValue --> ${(attributeValues['MC_Width']!0) + (involvedObject?size)} ${rules[1].conditionResult.involvedObject[0]} Class: UpdateTranslation Parameters
|
Write To Log File | Writes the specified Message into the system log file under the specified log level <#if involvedObject??> attributes are missing: <#list involvedObject as attrId> - ${attrId} </#list> </#if> Class: WriteToLogFile Parameters
|
Create Notification (experimental ⚗️) | Creates Notification for the specified User with specified Type, Subject, Message and Expired date. The subject and message support Freemarker expressions to access the product data. For example, if it is necessary to mention the Product's ID then use ${product.productId} in subject or message. See also Notifications and Notifications & Tasks features toggling. Class: CreateNotification Parameters
|
Create Task (experimental ⚗️) | Creates Task to specified User with specified Subject, Description and Deadline date. The subject and description support Freemarker expressions to access the product data. For example, if it is necessary to mention the Product's ID then use ${product.productId} in subject or description. See also Tasks and Notifications & Tasks features toggling. Class: CreateTask Parameters
|