-
Hi, So imagine 3 states:
And these transitions:
In the A method the returned NextState is B since this is how I want it to behave, but if I change it to return C this also works. In the logs I see a warning mentioning the state transition is not allowed. But looking at the actual state of of the instance in Nflow explorer it has transitioned anyway. This also happens when doing manual updates using the API. When I transition it to B, it is waiting for the state to be updated using the REST API (or via a Java code). Using Nflow explorer I can set the state to C which is permitted, but I can also set it to A while this should not be possible. I don't even see a warning in the logs. Am I missing something here? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
have you looked at this parameter nflow.illegal.state.change.action based on what you want, set this to "fail" ? |
Beta Was this translation helpful? Give feedback.
-
Thanks, your suggestion is working! Unfortunately the documentation is not very complete and this property is not documented. But I've checked out the code now and this provides some useful insights. Anyway, this property only 'guards' automatic transitions and moves the WF to error. This is what I expect. But using the API I can still move to any state, despite not being permitted. |
Beta Was this translation helpful? Give feedback.
(
nflow.illegal.state.change.action
is documented here)Indeed, setting any workflow state (from state methods and via APIs) is intentionally allowed, as it may be needed in some cases.
nflow.illegal.state.change.action
is not currently checked when the state change is made via APIs. It could be added though.We could also consider adding support to control this on request level, possibly by adding a parameter like
expectedStates
inWorkflowInstanceService.wakeupWorkflowInstance
, oractionOnIllegalStateChange
similar tonflow.illegal.state.change.action
with additional option to deny the change. Please create an issue if you think this sounds like a good idea and would solve your problem.F…