I have three Rules to do something after saving content. I need to know which one is executed first and how I can control this order?

Is there a certain answer for this question?


It's based on the weight. Edit the Rule settings and you'll find a drop down to set the weight. I believe those with a lighter weight, e.g. -1, are executed before those with heavier weight, e.g. 5.

  • to "view" what is happening, on each rule add an action "display a system message". e.g. on rule with weight -1 say "on rule number 1, weight -1", when you are done, delete the messages. – pinueve Mar 1 '16 at 17:57

You can set a weight for each rule.

enter image description here


Something that will help you find the answer to your question, is to have a look at Rules debugging ... Within the Rules settings, experiment a bit with the debugging facilities that come with the rules module. At least have a look at the "Rules Evaluation Log" (to check that the Rules logic being executed, actually matches what you expect that logic to be).

Depending on what the result of that type of debugging is, you may also want to (temporary) enable the Devel module, so that you can (temorary) add a Rules Action like "Display a value" (in your case of the entire node/webform that's used to submit that attached file).

For way more details about these 2 variations, refer to Rules debugging, as explained in the answer to "How can I display the value of a variable inside a condition?".

To actually control the order of execution of 3 rules, you may want to implement these 3 rules as Rules Components, and then build a 4th rule in which the Rules action is to execute these 3 rules components ... in the exact order that "you" want them to be executed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.