fix(workflow-engine-*): pass container to flow (#9180)
This commit is contained in:
committed by
GitHub
parent
1c4d3f32cb
commit
adbeb9cc1d
@@ -166,17 +166,14 @@ export class WorkflowOrchestratorService {
|
||||
)
|
||||
}
|
||||
|
||||
const flow = exportedWorkflow(
|
||||
(container as MedusaContainer) ?? this.container_
|
||||
)
|
||||
|
||||
const ret = await flow.run({
|
||||
const ret = await exportedWorkflow.run({
|
||||
input,
|
||||
throwOnError,
|
||||
logOnError,
|
||||
resultFrom,
|
||||
context,
|
||||
events,
|
||||
container: container ?? this.container_,
|
||||
})
|
||||
|
||||
const hasFinished = ret.transaction.hasFinished()
|
||||
@@ -276,17 +273,13 @@ export class WorkflowOrchestratorService {
|
||||
throw new Error(`Workflow with id "${workflowId}" not found.`)
|
||||
}
|
||||
|
||||
const flow = exportedWorkflow(
|
||||
(container as MedusaContainer) ?? this.container_
|
||||
)
|
||||
|
||||
const events = this.buildWorkflowEvents({
|
||||
customEventHandlers: eventHandlers,
|
||||
transactionId,
|
||||
workflowId,
|
||||
})
|
||||
|
||||
const ret = await flow.registerStepSuccess({
|
||||
const ret = await exportedWorkflow.registerStepSuccess({
|
||||
idempotencyKey: idempotencyKey_,
|
||||
context,
|
||||
resultFrom,
|
||||
@@ -294,6 +287,7 @@ export class WorkflowOrchestratorService {
|
||||
logOnError,
|
||||
events,
|
||||
response: stepResponse,
|
||||
container: container ?? this.container_,
|
||||
})
|
||||
|
||||
if (ret.transaction.hasFinished()) {
|
||||
@@ -343,17 +337,13 @@ export class WorkflowOrchestratorService {
|
||||
throw new Error(`Workflow with id "${workflowId}" not found.`)
|
||||
}
|
||||
|
||||
const flow = exportedWorkflow(
|
||||
(container as MedusaContainer) ?? this.container_
|
||||
)
|
||||
|
||||
const events = this.buildWorkflowEvents({
|
||||
customEventHandlers: eventHandlers,
|
||||
transactionId,
|
||||
workflowId,
|
||||
})
|
||||
|
||||
const ret = await flow.registerStepFailure({
|
||||
const ret = await exportedWorkflow.registerStepFailure({
|
||||
idempotencyKey: idempotencyKey_,
|
||||
context,
|
||||
resultFrom,
|
||||
@@ -361,6 +351,7 @@ export class WorkflowOrchestratorService {
|
||||
logOnError,
|
||||
events,
|
||||
response: stepResponse,
|
||||
container: container ?? this.container_,
|
||||
})
|
||||
|
||||
if (ret.transaction.hasFinished()) {
|
||||
|
||||
@@ -220,6 +220,7 @@ export class WorkflowOrchestratorService {
|
||||
resultFrom,
|
||||
context,
|
||||
events,
|
||||
container: container ?? this.container_,
|
||||
})
|
||||
|
||||
const hasFinished = ret.transaction.hasFinished()
|
||||
@@ -332,6 +333,7 @@ export class WorkflowOrchestratorService {
|
||||
logOnError,
|
||||
events,
|
||||
response: stepResponse,
|
||||
container: container ?? this.container_,
|
||||
})
|
||||
|
||||
if (ret.transaction.hasFinished()) {
|
||||
@@ -381,17 +383,13 @@ export class WorkflowOrchestratorService {
|
||||
throw new Error(`Workflow with id "${workflowId}" not found.`)
|
||||
}
|
||||
|
||||
const flow = exportedWorkflow(
|
||||
(container as MedusaContainer) ?? this.container_
|
||||
)
|
||||
|
||||
const events = this.buildWorkflowEvents({
|
||||
customEventHandlers: eventHandlers,
|
||||
transactionId,
|
||||
workflowId,
|
||||
})
|
||||
|
||||
const ret = await flow.registerStepFailure({
|
||||
const ret = await exportedWorkflow.registerStepFailure({
|
||||
idempotencyKey: idempotencyKey_,
|
||||
context,
|
||||
resultFrom,
|
||||
@@ -399,6 +397,7 @@ export class WorkflowOrchestratorService {
|
||||
logOnError,
|
||||
events,
|
||||
response: stepResponse,
|
||||
container: container ?? this.container_,
|
||||
})
|
||||
|
||||
if (ret.transaction.hasFinished()) {
|
||||
|
||||
Reference in New Issue
Block a user