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