How define external function call within a guard of state machine in EA

215 views Asked by At

As a follow up topic of this question , I would like to use a external function call of a class ( bool MyClas:: myFunc()) in order to evaluate a guard in EA. Is it possible to do this? This topic showed me how to assign external actions and function calls to the Effect field. I would also like to do it for the Guard field

The reason behind is that I want to separate the logic regarding the state machine (" go from state A to state B ") from the logic regarding the transitions ( here I want to write manual code for each guard implementation).

1

There are 1 answers

2
qwerty_so On

You can not evaluate a method's return value as guard. You can only set the behavior of a transition to some method since the guard itself is plain text:

enter image description here

You could use some naming convention, though.

Also you can consider using a trigger like this:

enter image description here

Still, this is not a result from a function.