fix(workflow-sdk): Async/nested runAsStep propagation (#12675)
FIXES CLO-524 **What** Add hidden stepDefinition object as part of the step argument and ensure the runAsStep handlers rely on the latest definition when config is being used on the returned step in order to ensure async configuration propagation and nested configuration
This commit is contained in:
committed by
GitHub
parent
b456044060
commit
1a78476608
@@ -268,8 +268,12 @@ export class WorkflowOrchestratorService {
|
||||
await this.triggerParentStep(ret.transaction, result)
|
||||
}
|
||||
|
||||
if (throwOnError && ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
|
||||
if (ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
}
|
||||
|
||||
throw ret.errors[0].error
|
||||
}
|
||||
|
||||
return { acknowledgement, ...ret }
|
||||
@@ -373,8 +377,12 @@ export class WorkflowOrchestratorService {
|
||||
await this.triggerParentStep(ret.transaction, result)
|
||||
}
|
||||
|
||||
if (throwOnError && ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
|
||||
if (ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
}
|
||||
|
||||
throw ret.errors[0].error
|
||||
}
|
||||
|
||||
return { acknowledgement, ...ret }
|
||||
@@ -467,8 +475,12 @@ export class WorkflowOrchestratorService {
|
||||
await this.triggerParentStep(ret.transaction, result)
|
||||
}
|
||||
|
||||
if (throwOnError && ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
|
||||
if (ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
}
|
||||
|
||||
throw ret.errors[0].error
|
||||
}
|
||||
|
||||
return ret
|
||||
@@ -534,8 +546,12 @@ export class WorkflowOrchestratorService {
|
||||
await this.triggerParentStep(ret.transaction, result)
|
||||
}
|
||||
|
||||
if (throwOnError && ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
if (throwOnError && (ret.thrownError || ret.errors?.length)) {
|
||||
if (ret.thrownError) {
|
||||
throw ret.thrownError
|
||||
}
|
||||
|
||||
throw ret.errors[0].error
|
||||
}
|
||||
|
||||
return ret
|
||||
|
||||
Reference in New Issue
Block a user