/** * Executes the component with the previously set context. * * @return mixed[] * The array of provided context values, keyed by context name. * * @throws \Drupal\rules\Exception\RulesEvaluationException * Thrown if the Rules expression triggers errors during execution. */ public function execute() { $this->expression->executeWithState($this->state); $this->state->autoSave(); $result = []; foreach ($this->providedContext as $name) { $result[$name] = $this->state->getVariableValue($name); } return $result; }