src/Execution.php
public function introduceConcurrentRoot($active = false)
    {
        $this->engine->debug('Introducing concurrent root into {execution}', [
            'execution' => (string) $this
        ]);
        
        $parent = $this->parentExecution;
        
        $root = new static(UUID::createRandom(), $this->engine, $this->model, $parent);
        $root->setActive($active);
        $root->variables = $this->variables;
        $root->setState(self::STATE_SCOPE, $this->isScope());
        
        if ($parent !== null) {
            foreach ($parent->childExecutions as $index => $exec) {
                if ($exec === $this) {
                    unset($parent->childExecutions[$index]);
                }
            }
        }
        
        $this->setParentExecution($root);
        $this->setState(self::STATE_CONCURRENT, true);
        $this->setState(self::STATE_SCOPE, false);
        $this->variables = [];
        
        $this->markModified();
        
        $this->engine->registerExecution($root);
        
        return $root;
    }
public function introduceConcurrentRoot($active = false)
    {
        $this->engine->debug('Introducing concurrent root into {execution}', [
            'execution' => (string) $this
        ]);
        
        $parent = $this->parentExecution;
        
        $root = new static(UUID::createRandom(), $this->engine, $this->model, $parent);
        $root->setActive($active);
        $root->variables = $this->variables;
        $root->setState(self::STATE_SCOPE, $this->isScope());
        
        if ($parent !== null) {
            foreach ($parent->childExecutions as $index => $exec) {
                if ($exec === $this) {
                    unset($parent->childExecutions[$index]);
                }
            }
        }
        
        $this->setParentExecution($root);
        $this->setState(self::STATE_CONCURRENT, true);
        $this->setState(self::STATE_SCOPE, false);
        $this->variables = [];
        
        $this->markModified();
        
        $this->engine->registerExecution($root);
        
        return $root;
    }
Introduce a new concurrent root as parent of this execution.

@param boolean $active
@return Execution