Prevent workflow next state

Hi Guys,

How to prevent the workflow next state means after validation goto next state otherwise remain on the same state.


Anyone please guide me on this

check the state and conditions in validate method.

I checked the validate method is not calling on change of workflow state.

I think the hook you want is on_update and/or on_update_after_submit:

on_update hook calling in multiple conditions
when workflow action perform on_update hook will call
any changes on the form docsave trigger will call the on_update hook also

so, how we confirm the hooks call is related to workflow action?