You are here

function rules_execute_element in Rules 6

Executes the element by invoking the element type's execution handler

Parameters

$elements An array of elements to process:

$state The current evaluation state:

Return value

The execution result, or FALSE if there is no valid execution handler.

1 call to rules_execute_element()
rules_evaluate_elements in rules/rules.module
Evaluates the elements in a recursive way The elements are a tree of rules, conditions, actions and logical operations (AND, OR,..)

File

rules/rules.module, line 392
Rules engine module

Code

function rules_execute_element(&$element, &$state) {
  if (isset($element['#type']) && isset($element['#execute']) && function_exists($element['#execute'])) {
    $element['#_evaluated'] = TRUE;
    $result = $element['#execute']($element, $state);
    return isset($element['#negate']) && $element['#negate'] == TRUE ? !$result : $result;
  }
  return FALSE;
}