spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.56k stars 611 forks source link

spring-statemachine-core 3.0.0 | StateMachineReactiveLifecycle sendEvent deprecated, in favor of? #946

Open patpatpat123 opened 3 years ago

patpatpat123 commented 3 years ago

Hello Spring state machine team,

Thank you for the release of 3.0.0 for spring-statemachine-core.

StateMachine<RefundState, EventTransitionFromPartner> stateMachine .sendEvent(MessageBuilder.withPayload(transitionEvent).build());

is now deprecated.

Unfortunately, the doc does not tell in favor of what it is deprecated. An update of the doc, or examples for conversion would help.

Thank you

AleksandrRadchenko commented 3 years ago

Looks like it's fixed already. Using v3.0.0 currently:

    /**
     * Send an event {@code E} to the region.
     * <p>
     * NOTE: this method is now deprecated in favour of a reactive methods.
     *
     * @param event the event to send
     * @return true if event was accepted
     * @deprecated in favor of {@link #sendEvent(Mono)}
     */
    @Deprecated
    boolean sendEvent(E event);