views:

1440

answers:

6

We are developing an application that involves a lot of different tests where each test lead the users to a number of steps. We are thinking of using a state machine framework to capture the states/transitions out of the code. We are also thinking of using rule engine to supplement on the rules. Anyone has experience with any state machine framework that would work with JBoss and/or Java? Thanks in advance.

-nguyen

+3  A: 

jbpm does this and integrates well with jboss. In my experience, it's pretty easy to use and is powerful.

sblundy
I took another look at jbpm and found it would fit great. Thanks much. I somehow got turned off when i first saw demo with the designer in version 4.0. I later came across a tutorial for version 3.2 which is easier to see how it would fulfill the need. Thanks again.
Nguyen Nguyen
The jbpm site is now http://jboss.org/jbpm
Thierry-Dimitri Roy
+1  A: 

if you are building some screen to screen transition - based system, then you should definately check out Spring WebFlow http://springframework.org/webflow

miceuz
+1  A: 

I have had very good experiences with using ragel to build easily maintainable state machines. The resulting java code is of very high quality. However, it is purely a state machine generator with no specific usage intended, so you might find other solutions that will more seamlessly work in a web related problem domain.

kasperjj
A: 

Thanks all for replying. I'm hoping to see one that doesn't involve code generation. Probably it is more along the line of defining states/transitions in xml file and the framework/api would allow the capability to walk through the transitions/states depending on the input states. (eg. defining methods to go to in the xml and framework/api use reflection to call those methods) Btw, the app i'm working on is not in web domain, it is system readiness test that contains a bunch of different unique tests that guide the user to test out each hardware components (probably similar to a cart checkout process in an e-commerce web app but with more rules and steps). Thanks again. -nguyen

Nguyen Nguyen
+1  A: 

Maybe you can take a look at JBoss PVM. It is still in alpha, but can be used to model any type of state machine. We are also looking into it for gui transitions.

http://www.jboss.org/jbossjbpm/pvm

link is dead and a search for pvm on that site jboss.org doesn’t return any results
Kissaki
A: 

I wrote a solution that uses annotations to drive a state machine you might be interested in. http://david-sundstrom.blogspot.com/2009/07/asynchronous-state-machines-using-java.html

David Sundstrom