function RulesComponent::executeWithArguments

Executes the component with the given values.

Parameters

mixed[] $arguments: The array of arguments; i.e., an array keyed by name of the defined context and the context value as argument.

Return value

mixed[] The array of provided context values, keyed by context name.

Throws

\Drupal\rules\Exception\LogicException Thrown if the context is not defined.

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

File

src/Engine/RulesComponent.php, line 273

Class

RulesComponent
Handles executable Rules components.

Namespace

Drupal\rules\Engine

Code

public function executeWithArguments(array $arguments) {
    $this->state = ExecutionState::create();
    foreach ($arguments as $name => $value) {
        $this->setContextValue($name, $value);
    }
    return $this->execute();
}