Description
Hey!
In order to decouple the logic into small pieces, I added the SSM recently to my project. Different states (of an object) require different properties to be set (special validation).
Example:
In the state "IN_PREPARATION", some detailed properties can still be empty.
In the state "PUBLIC_AVAILABLE", all properties have to be filled in (@notempty).
In my code, I added a Guard into the transition, which checks the additional validation. As I want to inform the user, invoking the API, I would like to throw an exception. The standard way is to just return "false", which does not provide the feedback WHY the guard actually rejected to transition.
For the first invocation it is working fine, but after I rerun the exact same call, the Guard is actually never invoked anymore.
Where is the best idea, to do the additional Validation, when not in the guard?