[jboss-user] [jBPM] - Using jBPM as state machine engine - is it a good idea?

Zdenek Hrib do-not-reply at jboss.com
Sun Nov 25 19:49:38 EST 2012


Zdenek Hrib [https://community.jboss.org/people/zdenek.hrib] created the discussion

"Using jBPM as state machine engine - is it a good idea?"

To view the discussion, visit: https://community.jboss.org/message/778239#778239

--------------------------------------------------------------
Hi,

I usualy have a database oriented application, which stores records, where one field of the record (one column in a row in database) stores something called "state" - eg. record is "new", "revised", "waiting for approval" or "cancelled". The state of the record should change automatically according to changes in other fields of the record - eg. if someone changes a description of a "new" record, it should be changed to "revised" but if amount > 100 than it should go to "waiting for approval" instead. I would like to have some library where I could in case of record update do something like this (pseudo-code):

Process process = createProcesFromDefinition("mydefinition.process");
process.setCurrentState(getStateFromDatabase());
process.setOldRecord(getRecordFromDatabase());
process.setNewRecord(getRecordWhichIsToBeSaved());
State state = process.computeResultingState();
storeStateToDatabase(state);

I would like to have the process definition in some kind of XML format, and the rules for decision about the resulting transition in MVEL (or something else supported by Drools/JBoss Rules).

Is it possible to use jBPM in this way - just as a state machine engine? Could someone point me in the right direction, which classes should I explore in the jBPM API to do this?

I have seen some examples, but they always start the process from the beginning - but I would like to "fast forward" the process in some other state, provide some data, and let the engine&rules to choose the next state.

Thank you
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/778239#778239]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121125/b83d0c33/attachment-0001.html 


More information about the jboss-user mailing list