GenericEventSubscriber::onRulesEvent has

    // Loop over all rules and execute them.
    foreach ($configs as $config) {
      /** @var \Drupal\rules\Entity\ReactionRule $config */
      $config->getExpression()
        ->executeWithState($state);
    }

That needs to be improved to clone the state per Rule, but merge back changes to the state as necessary; i.e. auto-saved variables need to be merged back.

When implementing this, check the d7 logic. But cloning $state while keeping the references on the typed data object should work. So adding/removing variables and blocked variables does not change the parent scope, while saved changes need to be handled.

This is important here, but also for things like handling RulesLoop execution and evaluating components.

Comments

fago created an issue. See original summary.

TR’s picture

Bump.

TR’s picture

Issue summary: View changes