Merge pull request #5702 from Budibase/fix/pc-fixes-automations
Account for object in failure condition
This commit is contained in:
commit
7ae1441fd2
|
@ -191,7 +191,6 @@ class Orchestrator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
index === parseInt(env.AUTOMATION_MAX_ITERATIONS) ||
|
index === parseInt(env.AUTOMATION_MAX_ITERATIONS) ||
|
||||||
index === loopStep.inputs.iterations
|
index === loopStep.inputs.iterations
|
||||||
|
@ -205,10 +204,25 @@ class Orchestrator {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let isFailure = false
|
||||||
if (
|
if (
|
||||||
this._context.steps[loopStepNumber]?.currentItem ===
|
typeof this._context.steps[loopStepNumber]?.currentItem === "object"
|
||||||
loopStep.inputs.failure
|
|
||||||
) {
|
) {
|
||||||
|
isFailure = Object.keys(
|
||||||
|
this._context.steps[loopStepNumber].currentItem
|
||||||
|
).some(value => {
|
||||||
|
return (
|
||||||
|
this._context.steps[loopStepNumber].currentItem[value] ===
|
||||||
|
loopStep.inputs.failure
|
||||||
|
)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
isFailure =
|
||||||
|
this._context.steps[loopStepNumber]?.currentItem ===
|
||||||
|
loopStep.inputs.failure
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFailure) {
|
||||||
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
this.updateContextAndOutput(loopStepNumber, step, tempOutput, {
|
||||||
status: AutomationErrors.FAILURE_CONDITION,
|
status: AutomationErrors.FAILURE_CONDITION,
|
||||||
success: false,
|
success: false,
|
||||||
|
|
Loading…
Reference in New Issue