re-add branch step to outputs
This commit is contained in:
parent
66fdf03398
commit
56641e06c3
|
@ -64,7 +64,7 @@ describe("Automation Scenarios", () => {
|
||||||
})
|
})
|
||||||
.run()
|
.run()
|
||||||
|
|
||||||
expect(results.steps[2].outputs.message).toContain("Branch 1.1")
|
expect(results.steps[4].outputs.message).toContain("Branch 1.1")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should execute correct branch based on string equality", async () => {
|
it("should execute correct branch based on string equality", async () => {
|
||||||
|
@ -92,7 +92,7 @@ describe("Automation Scenarios", () => {
|
||||||
})
|
})
|
||||||
.run()
|
.run()
|
||||||
|
|
||||||
expect(results.steps[0].outputs.message).toContain("Active user")
|
expect(results.steps[1].outputs.message).toContain("Active user")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should handle multiple conditions with AND operator", async () => {
|
it("should handle multiple conditions with AND operator", async () => {
|
||||||
|
@ -124,7 +124,7 @@ describe("Automation Scenarios", () => {
|
||||||
})
|
})
|
||||||
.run()
|
.run()
|
||||||
|
|
||||||
expect(results.steps[0].outputs.message).toContain("Active admin user")
|
expect(results.steps[1].outputs.message).toContain("Active admin user")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should handle multiple conditions with OR operator", async () => {
|
it("should handle multiple conditions with OR operator", async () => {
|
||||||
|
@ -162,7 +162,7 @@ describe("Automation Scenarios", () => {
|
||||||
})
|
})
|
||||||
.run()
|
.run()
|
||||||
|
|
||||||
expect(results.steps[0].outputs.message).toContain("Special user")
|
expect(results.steps[1].outputs.message).toContain("Special user")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -461,6 +461,19 @@ class Orchestrator {
|
||||||
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 = {
|
||||||
|
status: `${branch.name} branch taken`,
|
||||||
|
success: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.updateExecutionOutput(
|
||||||
|
branchStep.id,
|
||||||
|
branchStep.stepId,
|
||||||
|
branchStep.inputs,
|
||||||
|
branchStatus
|
||||||
|
)
|
||||||
|
this.context.steps[this.context.steps.length] = branchStatus
|
||||||
|
|
||||||
const branchSteps = children?.[branch.name] || []
|
const branchSteps = children?.[branch.name] || []
|
||||||
await this.executeSteps(branchSteps)
|
await this.executeSteps(branchSteps)
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue