You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the following error message from my _machineConfig.ForState() statement below when I run it:
"Permit* and Ignore* methods are exclusive to each other for a given resulting state."
I'm not quite sure how to interpret it. Does this mean that you can't have multiple PermitIf statements referring to the same parameterized trigger for the same state? In the example below, I'm reusing the same parameterized trigger using guard clauses to get from one state to 3 different states.
If you have the time, I'd appreciate some examples for PermitIf in the readme / sample to clarify thanks.
Simply put, PermitIf helpers are for very simple scenarios with a single condition for a single resulting state for a trigger. Its so that the configuration code is readable and simple. Thinks of triggers are your entry knobs for a sequence of actions. You turn a knob, and that knob has only one travel direction. Nothing more, nothing less. So, here you're providing the same knob, and providing three different conditions, and asking it to move in three different directions.
If that's how you'd like to approach it, use PermitDynamic. That should bypass all of this, and allow you to take complete control and move in whichever direction you want based on whatever condition . Use that and take and isolate the trigger's conditional mechanisms out of the state machine.
However, your right about the error message not being very helpful here. I will try to rectify that soon.
Hi Prasanna,
I'm getting the following error message from my _machineConfig.ForState() statement below when I run it:
"Permit* and Ignore* methods are exclusive to each other for a given resulting state."
I'm not quite sure how to interpret it. Does this mean that you can't have multiple PermitIf statements referring to the same parameterized trigger for the same state? In the example below, I'm reusing the same parameterized trigger using guard clauses to get from one state to 3 different states.
If you have the time, I'd appreciate some examples for PermitIf in the readme / sample to clarify thanks.
The text was updated successfully, but these errors were encountered: