Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java SDK does not have option to register workflow name statically #2122

Open
ftkurt opened this issue Jun 24, 2024 · 2 comments
Open

Java SDK does not have option to register workflow name statically #2122

ftkurt opened this issue Jun 24, 2024 · 2 comments
Labels
enhancement User experience

Comments

@ftkurt
Copy link

ftkurt commented Jun 24, 2024

Is your feature request related to a problem? Please describe.
I'm always frustrated when trying to register a Java workflow with a static name. The current option using annotations does not work for our use case. We define proto enums and share them across different apps so they can trigger workflows across apps. For instance, we have:

public interface MyWorkflow {
    @WorkflowMethod(name = "MyStaticWorkflowName")
    void execute();
}

We need a way to set a default workflow implementation type name during registration.

Describe the solution you'd like
A method to register a workflow with a static name during registration using something like:

WorkflowImplementationOptions options = WorkflowImplementationOptions.newBuilder()
        .setDefaultWorkflowImplementationTypeName(Workflows.WORKFLOWS_SEND_SUBMISSION.name())
        .build();

worker.registerWorkflowImplementationTypes(options, SendSubmissionWorkflowImpl.class);

This would allow us to define workflows that can be triggered across different apps with a shared static name.

Describe alternatives you've considered
Currently, the alternative is to use the short name of the workflow interface by default. However, this does not meet our needs as we cannot share interfaces across apps written in different languages (Golang, Python). Using annotations alone is insufficient for our scenario.

Additional context
Our apps in Golang and Python cannot share Java interfaces, hence the need for a static name registration method. We currently share these names through protobuf-defined enums which can be built for all apps and envs.

@ftkurt ftkurt added the enhancement User experience label Jun 24, 2024
@Quinn-With-Two-Ns
Copy link
Contributor

Would you also need the same functionality for activity names?

@ftkurt
Copy link
Author

ftkurt commented Jun 27, 2024

@Quinn-With-Two-Ns yes, that will be useful as well. We are running some activities cross platform as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User experience
Projects
None yet
Development

No branches or pull requests

2 participants