mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Remove unnecessary workflow deletion logic when in the initial position
This commit is contained in:
@@ -58,7 +58,6 @@ final readonly class CancelStaleWorkflowHandler
|
||||
$transitions = $workflowComponent->getEnabledTransitions($workflow);
|
||||
|
||||
$transitionApplied = false;
|
||||
$wasInInitialPosition = 'initial' === $workflow->getStep();
|
||||
|
||||
foreach ($transitions as $transition) {
|
||||
if ($this->willTransitionLeadToFinalNegative($transition, $metadataStore)) {
|
||||
@@ -80,10 +79,6 @@ final readonly class CancelStaleWorkflowHandler
|
||||
throw new UnrecoverableMessageHandlingException(sprintf('No valid transition found for EntityWorkflow %d.', $workflowId));
|
||||
}
|
||||
|
||||
if ($wasInInitialPosition) {
|
||||
$this->em->remove($workflow);
|
||||
}
|
||||
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user