Adjust test to work with actual workflow + minor fix of handler logic

This commit is contained in:
2024-08-28 14:27:27 +02:00
committed by Julien Fastré
parent cb446edd18
commit 2e69d2df90
3 changed files with 76 additions and 98 deletions

View File

@@ -35,7 +35,7 @@ class CancelStaleWorkflowHandler
$workflow = $this->workflowRepository->find($workflowId);
if (in_array($workflow, $staleWorkflows, true)) {
if (!in_array($workflow, $staleWorkflows, true)) {
$this->logger->alert('Workflow has transitioned in the meantime.', [$workflowId]);
return;
}
@@ -69,7 +69,7 @@ class CancelStaleWorkflowHandler
}
if (!$transitionApplied) {
$this->logger->error('No valid transition found for EntityWorkflow %d.', [$workflowId]);
$this->logger->error('No valid transition found for EntityWorkflow.', [$workflowId]);
throw new UnrecoverableMessageHandlingException(sprintf('No valid transition found for EntityWorkflow %d.', $workflowId));
}
}