protected function childExecutionTerminated(Execution $execution, $triggerExecution = true)
    {
        $removed = false;
        $scope = $execution->isScope() || !$execution->isConcurrent();
        
        foreach ($this->childExecutions as $index => $exec) {
            if ($exec === $execution) {
                unset($this->childExecutions[$index]);
                $removed = true;
                
                break;
            }
        }
        
        if (empty($this->childExecutions) && $scope && $removed && $triggerExecution) {
            if ($this->isWaiting()) {
                $this->signal(null, [], [
                    'executionId' => $execution->getId()
                ]);
            } else {
                $this->takeAll(null, [
                    $this
                ]);
            }
        }
    }