spring-projects / spring-statemachine

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

flag to execute actions in sync way while accepting event #1021

Open yogeshpandey opened 2 years ago

yogeshpandey commented 2 years ago

Added a flag in statemachine to run all transition and state entry/exit actions in sync while accepting an event. This will allow the caller of sendEvent to know if there was any action failure and counter measures can be taken to handle failed execution.

This feature is very useful if we use a spring state machine for an Order use-case where Actions can update to database independently. Using this flag enables us to make the whole part sending event and execution of actions part of a single transaction.

pivotal-cla commented 2 years ago

@yogeshpandey Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla commented 2 years ago

@yogeshpandey Thank you for signing the Contributor License Agreement!

pdalfarr commented 3 weeks ago

@yogeshpandey so without this modification, sending event and execution of actions is NOT part of a single DB transaction?

I would prefer this PR to be accepted, but in the mean time, I am searching for an alternative, hence this question: Is it a way to cope with that without the modification in this PR?

Thanks