You are here

function rules_get_execution_arguments in Rules 6

Returns the execution arguments needed by the given element It applies the input evaluators and the #argument map and gets all needed arguments.

Parameters

$element The configured element, which is to be executed:

$state The current evaluation state:

Return value

If not all execution arguments are available, it returns FALSE

2 calls to rules_get_execution_arguments()
rules_execute_action in rules/rules.module
Execution handler for actions
rules_execute_condition in rules/rules.module
Execution handler for conditions Note: An condition may not alter arguments

File

rules/rules.variables.inc, line 152
Provides functions and classes for handling variables

Code

function rules_get_execution_arguments(&$element, &$state) {

  //apply the input evaluators
  $success = rules_apply_input_evaluators($element, $state);
  if ($success === FALSE) {
    rules_log(t('Element "@name" has not been executed. There are not all execution arguments needed by an input evaluator available.', array(
      '@name' => rules_get_element_label($element),
    )));
    return FALSE;
  }

  // First off get the arguments of the element as specified.
  $exec_args = rules_get_element_arguments($element, $state);
  if ($exec_args !== FALSE) {

    // Then we always append some other useful variables
    $settings = isset($element['#settings']) ? $element['#settings'] : array();
    $exec_args[] = $settings;
    $exec_args[] = $element;
    $exec_args[] =& $state;
    return $exec_args;
  }
  rules_log(t('Element "@name" has not been executed. There are not all execution arguments available.', array(
    '@name' => rules_get_element_label($element),
  )));
  return FALSE;
}