Correctly complete automation run when there is an empty branch in if/else

[MAILPOET-6154]
This commit is contained in:
 Ján Mikláš
2024-07-22 22:32:46 +02:00
committed by Aschepikov
parent 63c19d2508
commit 2e13570dd7

View File

@ -150,6 +150,13 @@ class StepHandler {
$step->validate($validationArgs);
$step->run($args, $this->stepRunControllerFactory->createController($args));
// check if run is not completed by now (e.g., one of if/else branches is empty)
$automationRun = $this->automationRunStorage->getAutomationRun($runId);
if ($automationRun && $automationRun->getStatus() !== AutomationRun::STATUS_RUNNING) {
$logger->logSuccess();
return;
}
// schedule next step if not scheduled by action
if (!$this->stepScheduler->hasScheduledStep($args)) {
$this->stepScheduler->scheduleNextStep($args);