sdk-java icon indicating copy to clipboard operation
sdk-java copied to clipboard

Workflow.getWorkflowExecution fails if stub created via Workflow.newExternalWorkflowStub

Open tsurdilo opened this issue 3 years ago • 0 comments

      GreetingWorkflow parentWorkflow = Workflow.newExternalWorkflowStub(GreetingWorkflow.class,
          Workflow.getInfo().getParentWorkflowId().get());
      Promise<WorkflowExecution> parentExec = Workflow.getWorkflowExecution(parentWorkflow);

throws

   Caused by: java.lang.ClassCastException: class io.temporal.internal.sync.ExternalWorkflowStubImpl cannot be cast to class io.temporal.workflow.ChildWorkflowStub (io.temporal.internal.sync.ExternalWorkflowStubImpl and io.temporal.workflow.ChildWorkflowStub are in unnamed module of loader 'app')

per javadoc it should also work with externalworkflow stub

tsurdilo avatar May 31 '22 17:05 tsurdilo