feat: Workflow engine modules (#6128)
This commit is contained in:
committed by
GitHub
parent
d85fee42ee
commit
302323916b
@@ -81,9 +81,16 @@ export class WorkflowManager {
|
||||
const finalFlow = flow instanceof OrchestratorBuilder ? flow.build() : flow
|
||||
|
||||
if (WorkflowManager.workflows.has(workflowId)) {
|
||||
function excludeStepUuid(key, value) {
|
||||
return key === "uuid" ? undefined : value
|
||||
}
|
||||
|
||||
const areStepsEqual = finalFlow
|
||||
? JSON.stringify(finalFlow) ===
|
||||
JSON.stringify(WorkflowManager.workflows.get(workflowId)!.flow_)
|
||||
? JSON.stringify(finalFlow, excludeStepUuid) ===
|
||||
JSON.stringify(
|
||||
WorkflowManager.workflows.get(workflowId)!.flow_,
|
||||
excludeStepUuid
|
||||
)
|
||||
: true
|
||||
|
||||
if (!areStepsEqual) {
|
||||
@@ -131,14 +138,19 @@ export class WorkflowManager {
|
||||
}
|
||||
|
||||
const finalFlow = flow instanceof OrchestratorBuilder ? flow.build() : flow
|
||||
const updatedOptions = { ...workflow.options, ...options }
|
||||
|
||||
WorkflowManager.workflows.set(workflowId, {
|
||||
id: workflowId,
|
||||
flow_: finalFlow,
|
||||
orchestrator: new TransactionOrchestrator(workflowId, finalFlow, options),
|
||||
orchestrator: new TransactionOrchestrator(
|
||||
workflowId,
|
||||
finalFlow,
|
||||
updatedOptions
|
||||
),
|
||||
handler: WorkflowManager.buildHandlers(workflow.handlers_),
|
||||
handlers_: workflow.handlers_,
|
||||
options: { ...workflow.options, ...options },
|
||||
options: updatedOptions,
|
||||
requiredModules,
|
||||
optionalModules,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user