Description
Problem
The sample code in the reference documentation for conditional flows makes the critical assumption that stepA()
is a proxied bean method. If the method were not proxied, its two invocations would return different instances where the DSL expects to be passed the same instance twice. But the assumption is not explicitly stated.
This leads to a lot of confusion and produces a number of user issues, for example #4429, #4328, #4348, and #4153.
Possible solutions
One possibility would be to adjust the documentation. Either by adding a warning to the section (which might confuse readers to whom the concept of proxied methods is unknown) and/or by changing the code snippet to inject the steps as parameters to the method.
Another possibility would be to change the implementation to be more lenient. There are already places in the code where unique names for a Step
are assumed. Thus, AbstractStep
could implement equals
and hashCode
base on the the step name, which should also fix the issue. If this path is chosen, it would make sense to address #3757 at the same time.