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

Inheritance of workflow interfaces is not supported

Open Spikhalskiy opened this issue 3 years ago • 4 comments

  @WorkflowInterface
  public interface CustomerWorkflow {

    @WorkflowMethod
    void execute(Customer customer);

  }

  @WorkflowInterface
  public interface CustomerWorkflowWithSignal extends CustomerWorkflow {

    @SignalMethod(name = "setCustomer")
    void setCustomer(Customer customer);
  }

Registering two classes that implement the interfaces above should be possible, the second implementation should have a CustomerWorkflowWithSignal name.

Instead, it causes "java.lang.IllegalStateException: CustomerWorkflow workflow type is already registered with the worker".

Special consideration should be put into maintaining compatibility during the fix as it may change the workflow names for some users.

Spikhalskiy avatar Jan 21 '22 20:01 Spikhalskiy