Rules engine

The Rules engine is available as a separate plugin to Bluestone PIM.
You can access the Rules engine if you have the Rules engine read, Rules engine write or Plugin admin role.


Overview

Rules grid    Actions    Filters

Create a new rule

Assign to category    Generate PDF    Edit attribute value



Overview

The Rules engine allows you to automate different types of time-consuming tasks/actions. An action will be performed for the set of products matching the specified query. Currently, Bluestone PIM supports the following types of rules/actions:

You can find the Rules engine as a separate module in the main navigation bar:

The page is divided into two main parts; the Filters panel and the Rules grid. See the following sections for details.

Tip! Find out how to customize the menu bar.

Rules grid

You can view all rules created within the organization from the grid. For each rule, the Action, Target, Name, Context, Status and Run time are presented.

Hover a rule and click the 3-dots menu on the right-hand side to access the following actions:

RuleEngine_Rule-Grid-View_More-Options


Actions

Activate/Deactivate

Allows you to deactivate an active rule, or vice versa.

Edit 

Allows you to update the rule's main information and/or query.

Duplicate

Allows you to copy information from the rule into a new rule. The Target will not be copied for 'Assign to category' and 'Generate PDF' rules, as multiple rules for the same target are not allowed.

Delete

Allows you to remove a rule. Confirm the deletion by clicking Yes in the pop-up.

Filters

With a large set of rules, you can utilize Filters to find the rule(s) you are looking for.  

Do the following:

  1. Click the relevant section, e.g. Status, to expand it.
  2. Specify a filter criterion either by selecting a pre-defined value or typing a text, depending on the type of filter.

    Tip! Using the Product query contains filter efficiently finds rules based on attribute/attribute value used in the connected query.

  3. Repeat step 1 and 2 until you have added the required criteria.
  4. Click Apply filters.The rules matching your applied filter criteria are listed and the number of rules currently listed is presented in the header.

The applied criteria are presented above the grid. You can remove a specific filter criterion by clicking the 'x' in the pill for the relevant criteria.

Click Clear all to remove all filtering criteria.

 

Create a new rule

Follow these steps to create a new rule:

  1. Click the plus icon (Add new rule) in the upper right corner. 



    The Create new rule page is opened:



  2. Start by selecting the type of Action you want to automate.
  3. See the relevant section for details on how to proceed: 
    1. Assign to Category
    2. Generate PDF
    3. Edit attribute value


    Assign to category

    By creating a rule for automatically assigning products to categories, you can make sure that your products are present in the correct catalogs/categories as a result of other data being added, updated or removed in Bluestone PIM. 

    Do the following to create a rule for automatically assigning (and opt. unassigning) products to categories:

    1. Select Assign to category in the Action field.



    2. Select the relevant Context.
    3. Select the relevant Target category. This is the category products matching the query will be assigned to.
    4. Optionally select Unassign products from the category if the conditions do not match, to automatically remove products from this category when they don't match the query anymore.
    5. Run Time will be set to Event based. This means that the rule will be evaluated for a product when the given event(s) occur.
    6. Set relevant Run priority. This will determine when the rule will be executed. Rules in 'Priority group 1' will be run first, then the rules in 'Priority group 2' etc.
    7. Optionally specify a Name for the rule.
    8. Set Status of the rule to Active if it should be executed immediately after saving it. You can leave it Inactive and activate it directly from the grid at a later stage, please see Actions.
    9. Click Edit query in the Products section to define conditions for products to be handled by the rule. Once a query is created, the number of products matching the query is displayed.

      RuleEngine_Edit-Query_Example

      Tip! Please see Filtering using the query builder for details about how to build a query.

    10. In the Triggers section, specify which events that will cause the rule to be evaluated for a product. 

      Note! By default, Generate triggers from query is selected. This results in elements used in the query being added as triggers.
      Alternatively, turn off automatically generating triggers to specify events manually instead. Please see Trigger events for further details.

    11. Click Save when you are done.

    Generate PDF

    This option will be available if the Product PDF plugin is activated for your organization. Contact your system administrator if the option should have been but is not available to you.


    Automatic generation of PDF documents allows you to make sure that your product documents (e.g. data sheets) are updated once product data is updated in Bluestone PIM.

    A new version of a specific PDF document will replace the current version. All PDFs generated for a product are available from the product's Assets tab. Each PDF document will be labeled with the template's name.

    Do the following to create a rule for generating PDFs:

    1. Select Generate PDF in the Action field.

      RuleEngine_Action_Generate-PDF

    2. Select the relevant Context.
    3. Select the relevant template as Target. This is the template that will be used for generating the PDFs. There can only be one rule per template.
    4. Optionally click Add trigger events from template, to automatically add trigger events based on elements used in the template.
    5. Run Time will be set to Scheduled daily. Specify the time of day you want the rule to be evaluated for a product after the given event(s) occur.
    6. Optionally specify a Name for the rule.
    7. Set Status of the rule to Active if it should be executed immediately after saving it. You can leave it Inactive and activate it directly from the grid at a later stage, please see Actions.
    8. Click Edit query in the Products section to define conditions for products to be handled by the rule. Once a query is created, the number of products matching the query is displayed.

      Tip! Please see Filtering using the query builder for details about how to build a query.

    9. In the Triggers section, specify which events that will cause the rule to be evaluated for a product. 

      Note! If you have selected Add trigger events from template, elements used in the template are added as triggers. These should be considered as suggestions and optionally edited/removed. You can specify events manually in addition. Please see Trigger events for further details.

    10. Click Save when you are done.
    When a PDF generation process has started, the job will be listed in the System monitor and you can follow the progress from there: 

      RuleEngine_Generate-PDF_Auto_System-monitor



      Edit attribute value

      By creating a rule for automatically editing attribute values, you can make sure that your product information is up to date as a result of other data being added, updated or removed in Bluestone PIM.

      Do the following to create a rule for automatically editing a product attribute value:

      1. Select Edit attribute value in the Action field.



      2. Select the relevant Context.
      3. Select the relevant attribute as Target. This is the attribute that will be updated.

        Note! If a product handled by the rule does not have the attribute assigned already, it will be added.

        If you don't want the attribute to be assigned to products, add a condition for '<attribute> is assigned to product' to the query.

      4. Specify the Value to be set. Depending on the attribute type, select one/more pre-defined values or type a text.

        Tip! You can leave the field blank to automatically remove values for products matching the query.

      5. Optionally click Add trigger events from template, to automatically add trigger events based on elements used in the template.
      6. Run Time will be set to Event based. This means that the rule will be evaluated for a product when the given event(s) occur.
      7. Set relevant Run priority. This will determine when the rule will be executed. Rules in 'Priority group 1' will be run first, then the rules in 'Priority group 2' etc.
      8. Optionally specify a Name for the rule.
      9. Set Status of the rule to Active if it should be executed immediately after saving it. You can leave it Inactive and activate it directly from the grid at a later stage, please see Actions.
      10. Click Edit query in the Products section to define conditions for products to be handled by the rule. Once a query is created, the number of products matching the query is displayed.

        Tip! Please see Filtering using the query builder for details about how to build a query.

      11. In the Triggers section, specify which events that will cause the rule to be evaluated for a product. 

        Note! By default, Generate triggers from query is selected. This results in elements used in the query being added as triggers.
        Alternatively, turn off automatically generating triggers to specify events manually instead. Please see Trigger events for further details.

      12. Click Save when you are done.

      Create trigger events

      Different events can be used to make the rule being evaluated for a product. There must be at least one trigger connected to each rule. 

      Triggers can be automatically generated. For 'Assign to category' and 'Edit attribute value' rules, elements used in the connected query will be added as triggers when Generate triggers from query is selected. Alternatively, you can turn off automatically generating triggers and specify relevant events manually instead.

      For 'Generate PDF' rules, elements used in the PDF template will be added as triggers when Add trigger events from template is selected. Optionally, triggers can be created manually in addition.

      Do the following to manually create a trigger:

      1. Turn off the Generate triggers from query option (only relevant for 'Assign to category' and 'Edit attribute value').
      2. Click the plus icon (Add new trigger) to the right in the Triggers section.
      3. Select the relevant entity in the first dropdown, and the relevant event type in the second dropdown. Choices will vary depending on the selected Action.

        The rule can be evaluated for a product when there is a change regarding one/more of these entities:
        1. Asset with labels ('Generate PDF' action only)
          When the value changes for a product having an asset with the selected label. 
        2. Attribute
          When the value of the selected attribute changes for the product.
        3. Attribute group ('Generate PDF' action only) 
          When the value of an attribute in the selected group changes for the product. 
        4. Category
          When a category is assigned to or unassigned from the product. 
        5. Product
          When the product is created or the product description, name, number, label or status changes. 
        6. Completeness
          When the product's completeness score changes. 
      4. In the last dropdown, select whether the source of the event should be in the 'Product that triggered event', 'Variant group of product that triggered event' or 'Variant of product that triggered event'.

       

      Back to top