uneeded boolean

This commit is contained in:
Peter Clement 2024-09-11 15:00:39 +01:00
parent 1947000f0c
commit 56b727a245
1 changed files with 14 additions and 16 deletions

View File

@ -463,11 +463,11 @@ class Orchestrator {
}
private async executeBranchStep(branchStep: BranchStep): Promise<void> {
const { branches, children } = branchStep.inputs
const conditionMet = false
for (const branch of branches) {
const condition = await this.evaluateBranchCondition(branch.condition)
if (condition) {
let branchStatus = {
const branchStatus = {
status: `${branch.name} branch taken`,
success: true,
}
@ -482,22 +482,20 @@ class Orchestrator {
const branchSteps = children?.[branch.name] || []
await this.executeSteps(branchSteps)
break
return
}
}
if (!conditionMet) {
this.stopped = true
this.updateExecutionOutput(
branchStep.id,
branchStep.stepId,
branchStep.inputs,
{
success: false,
status: AutomationStatus.NO_CONDITION_MET,
}
)
return
}
this.stopped = true
this.updateExecutionOutput(
branchStep.id,
branchStep.stepId,
branchStep.inputs,
{
success: false,
status: AutomationStatus.NO_CONDITION_MET,
}
)
}
private async evaluateBranchCondition(