- Issue created by @freelock
We are using State Machine to provide buttons on entities to move them to different states. We want to be able to hide these buttons if the state transition should not be allowed -- for example, some fields are not currently set on a node, or a user needs a certain role to do the state transition.
1. Create a state machine workflow, and add it to a content type.
2. Create an ECA to move a node through a workflow.
3. Set the state machine field to "transition form" on a display.
4. See that anybody with permission to update the node can see all transition buttons.
Add an event, "Evaluate a State Machine Guard" or similar, to handle these.
The end result of evaluating a guard should be a boolean return code. I'm not sure how best to model this -- maybe make an action for returning the guard state?
Also seems worthwhile to support an exception workflow, to have the event handler return false if any following action throws an exception, or return true if not?
New ECA event and possibly action.
Active
2.0
Code