Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Update WorkflowExecutor.java
Browse files Browse the repository at this point in the history
  • Loading branch information
youngledo authored Dec 1, 2023
1 parent 2348851 commit 1e1ac46
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Workflow> future = new CompletableFuture<>();
Map<String, Object> inputMap = objectMapper.convertValue(input, Map.class);

Expand All @@ -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<Workflow> 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<Workflow> executeWorkflow(
ConductorWorkflow conductorWorkflow, Object input) {
String workflowId = this.doExecuteWorkflow(conductorWorkflow.getName(), conductorWorkflow.getVersion(), conductorWorkflow.toWorkflowDef(), input);
public CompletableFuture<Workflow> executeWorkflow(ConductorWorkflow conductorWorkflow, Object input) {
String workflowId = this.startWorkflow(conductorWorkflow.getName(), conductorWorkflow.getVersion(), conductorWorkflow.toWorkflowDef(), input);
runningWorkflowFutures.put(workflowId, future);
return future;
}
Expand Down

0 comments on commit 1e1ac46

Please sign in to comment.