Hello,

I am developing my own module and I need to test (evaluate) manually all rules corresponding to a specific event.

I used this to get rules attached to my event "my_event" :
$rules = rules_get_rule_set('my_event');

But how can I test the conditions of each rule ($my_rule['#conditions']) ? How can I pass $arguments values to each conditions ?

I tried this, but this does not work.

$arguments = array(
      'arg1' => $arg1,
      'arg2' => $arg2,
      'arg3' => $arg3,
    );
    $state = array(
        'variables' => $arguments,
    );
$result = rules_evaluate_elements($tax_rule['#conditions'], $state);

Thanks for your help.

Comments

mitchell’s picture

Component: Rules Engine » Rules Core
Status: Active » Closed (won't fix)

Thank you for submitting a support request / issue for Rules 1. Sorry it was not attended to earlier; I hope you found the information you were seeking in another resource, such as the Rules Drupal 6 documentation.

Because it has been a while since it was first submitted, I'm closing it to clear up space. However, if you would still like to submit another support request or help answer others support requests, your efforts would be welcomed and appreciated.