diff --git a/.changes/unreleased/Feature-20250626-143735.yaml b/.changes/unreleased/Feature-20250626-143735.yaml new file mode 100644 index 000000000..b1a447016 --- /dev/null +++ b/.changes/unreleased/Feature-20250626-143735.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Do not remove workflow which are automatically canceled after staling for more than 30 days +time: 2025-06-26T14:37:35.267672192+02:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/src/Bundle/ChillMainBundle/Service/Workflow/CancelStaleWorkflowHandler.php b/src/Bundle/ChillMainBundle/Service/Workflow/CancelStaleWorkflowHandler.php index d392df1ca..4dec39572 100644 --- a/src/Bundle/ChillMainBundle/Service/Workflow/CancelStaleWorkflowHandler.php +++ b/src/Bundle/ChillMainBundle/Service/Workflow/CancelStaleWorkflowHandler.php @@ -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(); }