Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selftransition miss option to ignore entry/exit #95

Open
oravecm opened this issue Mar 8, 2023 · 0 comments
Open

selftransition miss option to ignore entry/exit #95

oravecm opened this issue Mar 8, 2023 · 0 comments

Comments

@oravecm
Copy link

oravecm commented Mar 8, 2023

Hi Guys,

Execution of selftransition does not support option to ignore entry/exit actions. However in prevail cases this is what is required. Now, there is possibility to do it by using onEntryFrom. But from my point of view it is more as workaround.

Please, look for example bellow, and here are the issues I can see,
1, it complicates FSM, as you can see,
2, Adding just one selftransition to this state, where execution of entry/exit is not required, there must be simple one onEtry, replaced with all possible events which should execute action1 on entry.
3, Now imagine new event9 is added in state S5, which target state is S1. Simply, for this event entry action will be not executed till not added to S1 another onEntryFrom, what is error prone. I believe, there should be form of permit which
will do not execute entry/exit. So far we used to use SMC(https://smc.sourceforge.net/) as FSM, but for java I like to be able to use stateless4j lightweight alternative.

config.configure(S1)
        .onEntryFrom(EV1, ctx::action1)
        .onEntryFrom(EV2, ctx::action1)
        .onEntryFrom(EV3, ctx::action1)
        .onEntryFrom(EV4, ctx::action1)

        .permit(EV5, S2, ctx::action2)
        .permit(EV6, S3, ctx::action3)
        .permitDynamic(EV7, () -> S1, ctx::action4)
        .permitReentry(EV8, ctx::action5);

PS: sorry, it is not a bug, but I has not been able to change label

@oravecm oravecm added the bug label Mar 8, 2023
@ezaquarii ezaquarii added enhancement and removed bug labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants