Spring State Machine Transition Action Failure is not propogated - Stack Overflow

admin2025-04-24  2

The following state machine transition must fail and caller should be aware of that failure.

...
transitions
                .withExternal()
                    .source(NEW.name())
                    .target(STATE_A.name())
                    .event(NEW_RECEIPT.name())
                .and()
                .withLocal()
                    .source(STATE_A.name())
                    .target(STATE_B.name())
                    .event(CONTINUE.name())
                    .actionFunction(context -> Mono.error(new RuntimeException("something bad happened!")))
                .and()
                .withExternal()   
...

But that exception is not thrown and no logs for that. State machine points NEW.

it might be relevant with this comment.

转载请注明原文地址:http://anycun.com/QandA/1745458590a90719.html