From 1e1ac469236e97ccbe7ffa2b53a84141a44b9b66 Mon Sep 17 00:00:00 2001 From: huangxiao <68590897+youngledo@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:47:05 +0800 Subject: [PATCH] Update WorkflowExecutor.java --- .../sdk/workflow/executor/WorkflowExecutor.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java b/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java index c47d5bc43a..76d40bd699 100644 --- a/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java +++ b/java-sdk/src/main/java/com/netflix/conductor/sdk/workflow/executor/WorkflowExecutor.java @@ -154,7 +154,7 @@ public void initWorkers(String packagesToScan) { annotatedWorkerExecutor.initWorkers(packagesToScan); } - private String doExecuteWorkflow(String name, Integer version, WorkflowDef workflowDef, Object input) { + private String startWorkflow(String name, Integer version, WorkflowDef workflowDef, Object input) { CompletableFuture future = new CompletableFuture<>(); Map inputMap = objectMapper.convertValue(input, Map.class); @@ -167,21 +167,20 @@ private String doExecuteWorkflow(String name, Integer version, WorkflowDef workf return workflowClient.startWorkflow(request); } - public String executeWorkflow(String name, Integer version, Object input) { - String workflowId = this.doExecuteWorkflow(name, version, input); + public String executeWorkflowFuture(String name, Integer version, Object input) { + String workflowId = this.startWorkflow(name, version, input); runningWorkflowFutures.put(workflowId, future); return workflowId; } public CompletableFuture executeWorkflow(String name, Integer version, Object input) { - String workflowId = this.doExecuteWorkflow(name, version, input); + String workflowId = this.startWorkflow(name, version, input); runningWorkflowFutures.put(workflowId, future); return future; } - public CompletableFuture executeWorkflow( - ConductorWorkflow conductorWorkflow, Object input) { - String workflowId = this.doExecuteWorkflow(conductorWorkflow.getName(), conductorWorkflow.getVersion(), conductorWorkflow.toWorkflowDef(), input); + public CompletableFuture executeWorkflow(ConductorWorkflow conductorWorkflow, Object input) { + String workflowId = this.startWorkflow(conductorWorkflow.getName(), conductorWorkflow.getVersion(), conductorWorkflow.toWorkflowDef(), input); runningWorkflowFutures.put(workflowId, future); return future; }