spring-projects / spring-statemachine

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

UmlModelParser wrongly sets state action with spel #474

Closed ymyfrank closed 6 years ago

ymyfrank commented 6 years ago

I use Papyrus neo to design state machine definition. The language used: SPEL After I setup a state action("Do activity"), I expected it to be executed when stay in this state. The actual behavior is: state action not executed, unless it goes out of this state after another trigger. I found the code, which confused me: UmlModelParser:494, if state action language is LANGUAGE_BEAN, then put it into state actions which looks good. UmlModelParser:503, if state action language is LANGUAGE_SPEL, then put it into state exit actions which is confusing Can you tell if this is a bug, or a decent design for some painful reason?

ymyfrank commented 6 years ago

Currently I put all "state actions" into state entry actions as a work around

jvalkeal commented 6 years ago

Thanks for pointing it out as indeed line 503 is wrong as it should be like 494.

jvalkeal commented 6 years ago

Fixed in 1.2.x per https://github.com/spring-projects/spring-statemachine/commit/f524ea4f627c6bd5851eaaaeb0fcdfe2936e68aa