You are here

public function ActionSetExpression::executeWithState in Rules 8.3

Execute the expression with a given Rules state.

Note that this does not auto-save any changes.

Parameters

\Drupal\rules\Context\ExecutionStateInterface $state: The state with all the execution variables in it.

Return value

null|bool The expression may return a boolean value after execution, this is used by conditions that return their evaluation result.

Throws

\Drupal\rules\Exception\EvaluationException Thrown if the Rules expression triggers errors during execution.

Overrides ExpressionInterface::executeWithState

1 method overrides ActionSetExpression::executeWithState()
TestActionSetExpression::executeWithState in tests/src/Unit/ActionSetExpressionTest.php
Execute the expression with a given Rules state.

File

src/Plugin/RulesExpression/ActionSetExpression.php, line 29

Class

ActionSetExpression
Holds a set of actions and executes all of them.

Namespace

Drupal\rules\Plugin\RulesExpression

Code

public function executeWithState(ExecutionStateInterface $state) {

  // Use the iterator to ensure the actions are sorted.
  foreach ($this as $action) {

    /** @var \Drupal\rules\Engine\ExpressionInterface $action */
    $action
      ->executeWithState($state);
  }
}