Skip to content

Commit

Permalink
Fix little leftover bug in workflow api
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Mar 7, 2024
1 parent d3de7eb commit 6ef32e7
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class WorkflowImpl implements BindableComponent {

private static final StateKey<WorkflowExecutionState> WORKFLOW_EXECUTION_STATE_KEY =
StateKey.of("_workflow_execution_state", WORKFLOW_EXECUTION_STATE_SERDE);
private static final String START_HANDLER = "_start";

private final String name;
private final Component.Handler<?, ?> workflowMethod;
Expand Down Expand Up @@ -84,7 +85,8 @@ private WorkflowExecutionState submit(Context objectContext, InvokeRequest invok
.await();
if (response.equals(WorkflowExecutionState.STARTED)) {
// Schedule start
objectContext.send(workflowTarget(name), INVOKE_REQUEST_SERDE, invokeRequest);
objectContext.send(
Target.service(name, WorkflowImpl.START_HANDLER), INVOKE_REQUEST_SERDE, invokeRequest);
}

return response;
Expand Down Expand Up @@ -316,10 +318,6 @@ private Target workflowManagerTarget(String key, String handler) {
return Target.virtualObject(workflowManagerObjectName(name), key, handler);
}

private Target workflowTarget(String handler) {
return Target.service(name, handler);
}

// --- Components definition

@Override
Expand All @@ -331,7 +329,7 @@ public List<ComponentDefinition> definitions() {
HandlerSignature.of("submit", INVOKE_REQUEST_SERDE, WORKFLOW_EXECUTION_STATE_SERDE),
this::submit)
.with(
HandlerSignature.of("_start", INVOKE_REQUEST_SERDE, CoreSerdes.VOID),
HandlerSignature.of(START_HANDLER, INVOKE_REQUEST_SERDE, CoreSerdes.VOID),
(context, invokeRequest) -> {
this.internalStart(context, invokeRequest);
return null;
Expand Down

0 comments on commit 6ef32e7

Please sign in to comment.