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

If @component has value register activity with that value

Open javier-aliaga opened this issue 2 months ago • 5 comments

Description

Enable registering activities with custom names. @component value will be use as registration name

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • [ ] Code compiles correctly
  • [ ] Created/updated tests
  • [ ] Extended the documentation

javier-aliaga avatar Oct 22 '25 14:10 javier-aliaga

@javier-aliaga I would totally add a test to verify that if two Activities with the same name are registered from two different packages we know what happens. I do assume that if you just add a @Component without specifying the name it will use the FQN, if you add a name it will use that name instead, then leaving the responsibility to the user to assign unique names to the activities.

salaboy avatar Oct 22 '25 17:10 salaboy

@kendallroden @javier-aliaga I also think this deteriorates the developer experience forcing the user to assign a name just to avoid displaying something in the UI.

salaboy avatar Oct 22 '25 17:10 salaboy

@salaboy We can try to register the activities with com.longpackage.anotherpackage.lastpackage.MyClass and c.l.a.l.MyClass

The main problem is how to make this not a breaking change

javier-aliaga avatar Oct 23 '25 08:10 javier-aliaga

That's what I suggested to implement in the UI. We can do that in the SDK side, but if the user wants to see more info about what the abbreviated notation mean that is completely lost.

salaboy avatar Oct 23 '25 09:10 salaboy

I also think this deteriorates the developer experience forcing the user to assign a name just to avoid displaying something in the UI.

@salaboy I think with the evolution of the workflows the way we call activities may not be possible anymore (it will be possible as long as the class is in the classpath). It will be the case that the class is not present on the client side as it is being to be executed by another app even in a different language

javier-aliaga avatar Oct 23 '25 09:10 javier-aliaga