Manage your rules

Summary

Overview

Rules in Akeneo PIM automate product information enrichment. They apply actions to products and product models based on specific conditions. For more details, refer to our dedicated article about the rules engine.

You can create rules via the UI or by importing a YML file.

Create a Rule in the PIM UI

To create or edit rules, you need the appropriate permissions. Go to System/Roles, select a role, click Permissions/Rules, and enable Create rulesand/or Edit rules.

 

To create a rule in the UI, navigate to Settings/Rules and click Create. A pop-up will appear; enter a code and a label for your rule, then confirm. Your rule is now created, and you can define its product selection and actions.

After creating a rule, the edit screen shows two tabs: Rule Builder and Properties. In the Properties tab, you can set the rule's priority and its label translations. While these can be updated, the rule's code remains immutable.

The Rule Builder Tab

This tab is crucial for managing your rule's conditions and actions. First, filter the products you wish to update using the available filters under the Add Condition button.

Product Selection

In the Product selection section, define 'Conditions' using attributes or system fields to filter products/product models. These conditions together form your 'Product selection'.

For a complete list of attributes and system fields, please see our article.

 

If no conditions are set, the rule will apply to your entire product catalog.

 

System fields are listed first, followed by attributes grouped by type. Use the search bar to find specific attributes. Once a condition is added, its color changes to purple, and a new line appears in the product selection.

Each condition line includes the chosen system field or attribute (in purple) and an operator, which varies based on the filter. Additional fields, such as value, channel, and locale, may appear depending on the filter's requirements. To remove a condition, click the 'X' at the end of its line.

A counter next to the Add Condition button displays the number of products/product models that match your current conditions; this count updates automatically as you adjust conditions.

Available Conditions

You can use all system fields and attribute types in the PIM as conditions to select products/product models, including:

  • Categories
  • Family
  • Family variant
  • Groups
  • Status
  • Entity type (product or product model)
  • Identifier
  • Completeness
  • Parent
  • Creation date
  • Update date
  • Asset collection attribute
  • Date attribute
  • File attribute
  • Image attribute
  • Measurement attribute
  • Multi-select attribute
  • Simple select attribute
  • Number attribute
  • Text attribute
  • Boolean attribute
  • Text area attribute
  • Reference entity single link attribute
  • Reference entity multiple link attribute
  • Price attribute
  • Table attribute

Add Actions

After filtering your products/product models, you can add actions to apply to them:

  1. Click Add action at the top of the screen.
  2. Select the desired action from the list (use the search bar or scroll).
  3. A new section will appear below the Product Selection.

For a full list of actions available via YML file import, see the rules engine article. The table below details actions available through the PIM interface.

Available Actions

Set actions What they do
Set categories Classify products/product models into chosen categories, removing them from previous ones.
Set family Replace your products' families.
Set attribute value Set values for any attribute type, replacing old values.
Set groups Assign groups to your product selection (product models don't have groups).
Set associations Assign associations to products/product models (choose association type and target entity: products, product models, or groups).
Set quantified associations Assign quantified associations to products/product models (choose association type, target entity: products, product models, or groups, and quantity).
Set status Set a status for your product selection.
Add actions What they do
Add categories Classify products/product models into new categories without removing them from existing ones.
Add groups Add groups to your product selection (product models don't have groups).
Add attribute value Add values to multi-select, price collection, reference entity multiple links, or asset collection attributes, keeping existing values.
Add associations Add associations to products/product models (choose association type and target entity: products, product models, or groups).
Remove actions What they do
Remove categories Unclassify products/product models from selected categories.
Remove products from groups Remove products from groups (product models don't have groups).
Remove attribute values Remove values from multi-select, reference entity multiple links, or asset collection attributes.
Clear actions What they do
Clear attribute value Delete attribute values from your product/product model selection.
Clear associations Delete all associations from your product/product model selection.
Clear quantified associations Delete all quantified associations from your product selection.
Clear groups Delete all groups from your product selection (product models don't have groups).
Clear categories Unclassify products/product models from all categories.
Copy action What it does
Copy attribute value Copy a value from one attribute to another.
Calculate action What it does
Calculate attribute value Perform simple mathematical operations on numeric attribute values.
Concatenate action What it does
Concatenate attribute value Combine two or more values into a single value, useful for creating descriptions using free text, attribute fields, and line breaks.

Rules Engine Use Cases

The Akeneo Rules Engine is a powerful tool for automating repetitive tasks and ensuring data consistency, saving you valuable time and effort. Here are some practical use cases:

  • Automatic Attribute Population: As shown in the screenshot, you can automatically populate complex attribute values, like a size chart table, based on product selections (e.g., Family: "Mens Clothing", Gender: "Men", Size Type: "Regular"). This eliminates manual data entry for common product attributes.
  • Dynamic Categorization: Automatically assign products to categories based on their attribute values. For example, assign all products with "color" set to "red" and "in stock" to a "Red Clearance" category.
  • Data Standardization: Ensure consistent data across your catalog. For instance, if a product's "material" is "leather," automatically set its "care instructions" to "wipe with a damp cloth."
  • Enrichment based on Completeness: Identify products with missing essential attributes and automatically apply an action. For example, if the "description" field is empty for a product, copy content from a "short description" field to populate it.
  • Calculating Values: Perform mathematical operations on numeric attributes. For example, calculate the "selling price" by adding a pre-defined margin to the "cost price."
  • Cross-Attribute Enrichment: Copy values between different attribute types. For instance, copy a "brand name" from a simple text attribute to a reference entity single link attribute.

Create Rules via a YML Import

To create rules using a YML file, first create it, then import it into the PIM using the Rule import in YML import job.

For more details on executing an import, refer to Import your data.

 

You can also export rules using the Rule export in YML export job. For more details, see Export your data.

 

View All Rules

The Settings/Rules screen displays all rules created or imported in the PIM. You can search by rule code or label.

The last column shows tags indicating each rule's action type (add, copy, concatenate, set, calculate, remove, clear). You can also sort rules by priority.

Calculate the Number of Impacted Products Per Rule

To help validate rule conditions, you can calculate the number of products a rule will affect. The first execution might impact many products, but subsequent runs could affect fewer or none.

  1. Select one or more rules by checking the box on the left side of the screen.
  2. Click Calculate the impacted products.
  3. Confirm the action in the pop-up.
  4. A confirmation message will appear, and you'll be notified when the calculation is complete.

The number of impacted products will appear in the Impacted products column on the right side of your screen.

When a rule runs in Akeneo PIM, it only processes products whose Last update date has changed since the previous run, excluding unchanged products to speed up execution. This logic also applies when a rule is modified: the next execution will consider all products matching the new conditions as potential candidates.

This behavior does not apply if a rule:

  • Contains a condition on a date attribute.
  • Contains a condition on the Updated date.
  • Includes an action with a dynamic date (e.g., Now, Date in the past, or Date in the future).
 

 

Execute Rules

Rules run automatically four times daily (5 AM, 11 AM, 5 PM, and 11 PM UTC) and after bulk actions or imports with rules enabled.

When importing with rules, products without identifiers or UUIDs are skipped during immediate rule execution.

  • Rules will apply immediately after import for all products with identifiers or UUIDs.
  • For products skipped due to missing identifiers or UUIDs, rules will execute four times daily, similar to a standard import.
 

But you can also manually execute:

  • A single rule
  • A selection of rules
  • All rules (note: this may take a long time)

Rules support product models, allowing you to define rules based on attributes at the product model level (or sub-product model level).

 

The rule execution summary is available in the process tracker.

The summary provides details such as the number of rules executed, products/product models updated, and any warnings.

To view summaries of nightly scheduled rules in the process tracker, you must have the View all jobs in process tracker permission enabled under Roles.

 

Execute a Single Rule

To execute a rule, click Execute at the end of its line in the grid. A confirmation message will appear.

While editing or creating a rule, you can also execute it by clicking ..., then Save and execute.

Execute a Selection of Rules

To execute multiple rules at once:

  1. Select the rules by checking the box on the left side of each rule's line.
  2. Click Execute.
  3. Confirm the action in the pop-up.
  4. A confirmation message will appear, and you'll be notified upon completion.

Define a Status for a Rule

You can set a rule's Status to control its automatic execution. This is useful if you want to save a rule but not run it immediately.

To change a rule's status, go to its Properties tab and select either Enabled or Disabled.

The rules grid displays the status of each rule at a glance.

By default, new UI-created rules are disabled.

 

Duplicate a Rule

To avoid re-creating similar rules, you can duplicate an existing one. For example, if rules differ by only one condition.

To duplicate, access the rule edit form, click ..., then Save and duplicate. A creation pop-up will appear where you can enter a new code and label for your duplicated rule.

Duplicated rules are disabled by default. To execute them, change their status in the rule's Properties tab.

 

Delete Rules

Once a rule is deleted, the rule engine will no longer execute it, but products will retain values previously calculated by that rule.

 

Delete a Single Rule

To delete a rule, click Delete at the end of its line in the grid. Confirm the action in the pop-up.

If the Delete button is missing, you may lack the necessary permissions. See Manage your user roles.

 

Delete a Selection of Rules

To delete multiple rules at once:

  1. Select the rules by checking the box on the left side of each rule's line.
  2. Click Delete.
  3. Confirm the action in the pop-in.

Limitations

The rule engine has the following limitations:

  • 50 rules in the Growth package
  • 150 rules in the Advanced package
  • 600 rules in the Premium package

Contact your Customer Success Manager (CSM) if you need to increase this limit.