Programmatically Build a State Machine

Gary Russell

With the new Spring Statemachine project, can I create a state machine programmatically without using adapter classes available for JavaConfig and Spring @Configuration classes?

Janne Valkealahti

We're currently missing a generic builder pattern for building machine as a pojo. It's surely possible to use needed classes manually but looking a unit tests this approach is too verbose.

Based on discussions after we got 1.0.0.M1 out, a better low level builder api is needed. Although we can create a factory based on JavaConfig but still this may not be enough for some use cases.

I've created a new issue https://github.com/spring-projects/spring-statemachine/issues/45 to track this. So either we add a generic builder or if that model turns out to be too convoluted, then possibly a set of recipe modules could be used to create easy configuration for specific use cases.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related