Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically Build a State Machine

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

like image 968
Gary Russell Avatar asked Apr 18 '15 12:04

Gary Russell


1 Answers

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.

like image 99
Janne Valkealahti Avatar answered Nov 11 '22 09:11

Janne Valkealahti