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:
@@ -208,8 +208,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 }
|
||||
@@ -317,8 +321,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 }
|
||||
@@ -411,8 +419,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
|
||||
@@ -477,8 +489,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