Table of Contents

Rules

Pimics Rules are an engine that allows to define transformations of data from features into other entites. Rules are not processed immediately after the change, but on the background so there can be a small delay.

Define rules

  1. Choose the Search icon, enter Rule List and then choose the related link.
  2. On the Rules page, choose the New action.
  3. Select features that will be used as a source for the rule by creating a new line in Condition.
    1. Specify field Condition type as Feature
    2. Select Product Feature, click on (...) and select Product Feature ID/s to select them as a condition of the Rule. Item must contain this product feature in order for this rule to be applicable

Available rules

After installation there is a predefined set of Conditions or Actions.

Conditions

For Rule to function correctly Condition must be defined

Type Description Parameters
All Action will be run for all features -
Feature Action will be run only for selected Features Product Feature ID
Product Feature Filter Filter features by a condition defined in parameters Table No.: 70114120, Field No.: 1001, Value: INT100029..INT100030 => Action will be run for all features that have Number in range INT100029..INT100030

Actions

Type Description Parameters Example
Convert Units ToFeaturesID: INT100032 =? It use settings in Unit Conversion to convert a value from source feature into feature INT100032
Update Field Copy a value of feature to the selected field on Item, Categories, Documents Type: Item, Field No.: 2, Skip Validation: No => will update field Description when value is defined on item's feature
Rename Condition Value field will replace selected fields Value Type: Item, Field No.: 1 => will update field Item No. with Feature Value
Assign Document Will assign document to entity Type: Item group, Search in field: Code => will assign document to Item grupe based on Code
Math Operation Will execute selected Math Operation on Values from condition, or selected ones Operation: Addition, Values from Condition: blank => Will sum Numerical Values from Conditions
Write to Feature Will write resolute of previous Actions to selected Feature Value: *INT00001 => Will write resolute of previous action into Value of Feature INT00001

Run rules

Typicall scenario is that we run rules periodically on background. There is also possibility to run it manually from Product Features.

Important

Assign Document rule must be run on Features assigned to Document

Run rules on background

To process rules we use Job Queues, so you can run it every minute, hour or define your own period. Job (codeunit 70113878 "PIMX Rule Job") check the modification timestemp and if there is achnge since the last success run it starts all rules for the product feature.

Setup Rule Job

Please follow Microsoft documentation Use job queues to schedule tasks.

  1. Search for Job Queue Entries and select related link
  2. Create a new entry
  3. In Object Type to Run select Codeunit
  4. In Object ID to Run fill up 70113878
  5. There is no addition available configuration so keep Parameter String empty
  6. For the rest of the configuration follow Use job queues to schedule tasks.
  7. In the end select Set Status to Ready

Customizations

It is possible to extend rules in conditions and actions.

You need to implement interfaces:

  • interface "PIMX Rule Condition Type" and enum 70113796 "PIMX Pimcs Rule Condition Type"
  • interface "PIMX Rule Action Type" and enum 70113797 "PIMX Rule Action Type"

Please follow documentation and instructions available in the source code.

Realted Information

define features