The rules are in the form such that these can be inserted in the decision tree #830394: Converting ORs into ANDs. For the decision tree a node can have left, right children and data part. Data part would contain the condition. Now the conditions of the rules need to be inserted in the decision tree in such a way that every condition would be evaluated at max once.

Comments

Saubhagya’s picture

I used these two rules

sau2

Event	Operations
A comment has been published
 
Entity is new
Parameter: Entity: [comment]
 
NOT Entity has field
Parameter: Entity: [comment], Field: comment_body

Content is of type
Parameter: Content: [comment:node], Content types: article

Actions
None

and

sau

Event	
A comment has been published

Conditions
 
Entity is new
Parameter: Entity: [comment:parent]
 
NOT Content is sticky
Parameter: Content: [comment:node]
 
OR 
 
  NOT Content is promoted to frontpage
  Parameter: Content: [comment:node]

  Content is of type
  Parameter: Content: [comment:node], Content types: article

  AND
 
    NOT Entity has field
    Parameter: Entity: [comment], Field: comment_body
	 
    Content is published
    Parameter: Content: [comment:node]
	
Actions
None

and tree structure was like this:


Rules evaluation log

    * 0 ms Condition { "entity_is_new" : { "entity" : [ "comment:parent" ] } } at level 0
    * 0.032 ms Condition { "node_is_sticky" : { "node" : [ "comment:node" ] } } at level 1
    * 0.052 ms Condition { "node_is_of_type" : { "node" : [ "comment:node" ], "type" : { "article" : "article" } } } at level 2
    * 0.07 ms Condition { "entity_has_field" : { "entity" : [ "comment" ], "field" : "comment_body" } } at level 3
    * 0.098 ms Condition { "node_is_promoted" : { "node" : [ "comment:node" ] } } at level 2
    * 0.119 ms Condition { "node_is_of_type" : { "node" : [ "comment:node" ], "type" : { "article" : "article" } } } at level 3
    * 0.138 ms Condition { "entity_has_field" : { "entity" : [ "comment" ], "field" : "comment_body" } } at level 4
    * 0.156 ms Condition { "node_is_published" : { "node" : [ "comment:node" ] } } at level 5
    * 0.178 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.199 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.219 ms Condition { "node_is_published" : { "node" : [ "comment:node" ] } } at level 5
    * 0.238 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.258 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.278 ms Condition { "entity_has_field" : { "entity" : [ "comment" ], "field" : "comment_body" } } at level 4
    * 0.301 ms Condition { "node_is_published" : { "node" : [ "comment:node" ] } } at level 5
    * 0.32 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.34 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.361 ms Condition { "node_is_of_type" : { "node" : [ "comment:node" ], "type" : { "article" : "article" } } } at level 3
    * 0.379 ms Condition { "entity_has_field" : { "entity" : [ "comment" ], "field" : "comment_body" } } at level 4
    * 0.403 ms Rule { "rules_sau2" : { "LABEL" : "sau2", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 5
    * 0.418 ms Rule { "rules_sau2" : { "LABEL" : "sau2", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 5
    * 0.434 ms Rule { "rules_sau2" : { "LABEL" : "sau2", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 5
    * 0.449 ms Rule { "rules_sau2" : { "LABEL" : "sau2", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 5
    * 0.469 ms Condition { "entity_has_field" : { "entity" : [ "comment" ], "field" : "comment_body" } } at level 4
    * 0.491 ms Condition { "node_is_published" : { "node" : [ "comment:node" ] } } at level 5
    * 0.51 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.53 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.549 ms Condition { "node_is_published" : { "node" : [ "comment:node" ] } } at level 5
    * 0.568 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
    * 0.59 ms Rule { "rules_sau" : { "LABEL" : "sau", "PLUGIN" : "reaction rule", "REQUIRES" : [ "comment" ], "ON" : [ "comment_publish" ], "DO" : [] } } at level 6
Saubhagya’s picture

Version: » 7.x-1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.