Discussions

News: Implementing Finite State Machines with Physhun and Spring

  1. Processes involving multiple steps that require decision points within and outside of each step can be inordinately complex to program. But this type of process modeling has long-established solutions in computing. This article by Justin McCarter and Jim Ladd, presents the Physhun project, a Spring-based framework for implementing complex processes through Finite State Machine models. Physhun provides finite State Model persistence and transaction management with synchronous or asynchronous behavior. Read Article

    Threaded Messages (25)

  2. I'm not interested if it's inherently coupled to Spring.
  3. I am.
  4. I am.
    Would you still be interested in it if it weren't inherently coupled to Spring?
  5. :)[ Go to top ]

    Hey, thats not so complicated... You just need to put spring-ioc on classpath, spring-aop, spring-jdbc, spring-mvc, spring-jcr, spring-extras, spring-extras-extras, at least one (but it would be much better if you had more, or even more) xml file and here you have it :) I heard that with Spring you are able to implement even INfinite State Machine, just like wearing pants through your head :) Ok, but to be honest, do we really have to use Spring wherever we implement our own interfaces ? :)
  6. States hierarchical?[ Go to top ]

    I didn't see anything that says that states can be hierarchical. I only perused the article quickly and might have missed a sentence saying that states can be hierarchical. However, if they cannot I won't use this for anything heavy. Regards, Oliver
  7. Hierarchical states[ Go to top ]

    I didn't see anything that says that states can be hierarchical. I only perused the article quickly and might have missed a sentence saying that states can be hierarchical. However, if they cannot I won't use this for anything heavy.

    Regards, Oliver
    Oliver - what exactly do you mean by states being "hierarchical"?
  8. hierarchical[ Go to top ]

    Oliver - what exactly do you mean by states being "hierarchical"?
    Hi Justin, I was a little blunt in my reply... Well, what I mean is whether a state may consist of other states that may consist of other states and so on as with Harel state machines (also adopted by UML). Regards, Oliver
  9. re: hierarchical[ Go to top ]

    Oliver - nested models are supported.
  10. wery thanks good shared simple machines forum smf.gen.tr ödüllü seo webmaster yarışmasısimple machines forum smf.gen.tr ödüllü seo webmaster yarışmasısimple machines forum smf.gen.tr ödüllü seo webmaster yarışması Günlük Plan, Yıllık Plan, Öğretmen, Forum
  11. So why post? It never ceases to amaze me that people waste their time posting to topics that "don't interest" them. Why? Surely there must be more productive ways to spend one's time.
  12. So why post? It never ceases to amaze me that people waste their time posting to topics that "don't interest" them. Why? Surely there must be more productive ways to spend one's time.
    If I have misunderstood and it does not depend on Spring, then I might look more closely. Or, if it does depend on Spring it serves message to the developers that they could expand their user base by eliminating the dependency. It never ceases to amaze me that people waste their time criticizing people for posting to public forums. Surely there must be more productive ways to spend one's time. It's also annoying that these criticism often have more to do with the criticizers own preconceptions and prejudices than the posts they are actually criticizing.
  13. So why post? It never ceases to amaze me that people waste their time posting to topics that "don't interest" them. Why? Surely there must be more productive ways to spend one's time.


    If I have misunderstood and it does not depend on Spring, then I might look more closely. Or, if it does depend on Spring it serves message to the developers that they could expand their user base by eliminating the dependency.

    It never ceases to amaze me that people waste their time criticizing people for posting to public forums. Surely there must be more productive ways to spend one's time. It's also annoying that these criticism often have more to do with the criticizers own preconceptions and prejudices than the posts they are actually criticizing.
    You don't like Spring. Fine. You've said it again and again. So why not look at the header and move on? What possible satisfaction do you get restating the same position again and again? You are quick to point out bias, but like others of your bent, fail to point that eye inward. Even the response consisting of copying me is poor retread. Such a response is typical when one has no real agenda beyond tearing down a item they don't like merely because it is popular and they derive validation by "going against the herd."
  14. You don't like Spring. Fine. You've said it again and again. So why not look at the header and move on? What possible satisfaction do you get restating the same position again and again?
    I'm actually not aware that I've posted anything about disliking Spring so I call bullshit. I haven't formed much of an opinion on Spring. I have formed an opinion on what I see as Spring-mania. Maybe you have confused the two completely distinct and separate concepts. The fact is that you don't know me but you feel free to make broad assessments of my motivations. You should notice that haven't returned this 'favor'. I think it's extremely rude and disrespectful aside from being silly and childish.
    You are quick to point out bias, but like others of your bent, fail to point that eye inward.
    You took the time out of you busy day to criticize me about how I was wasting my time. You are not being rational. I was happily uninvolved in any discussion with you.
    Even the response consisting of copying me is poor retread.
    It's called pointing out irony. Apparently it is lost on you. You see, there's this thing called 'sarcasm'. You should consider learning about it. Here's a crash course. Unlike your post, my response to it wasn't serious. I didn't actually mean what I wrote. I think it's just dandy for people to post any fool thing they want as long as they don't fill the forums with so much nonsense that the forums become unusable.
  15. Comments and Question[ Go to top ]

    First off some comments. XML is a poor choice for configuring state graphs, it gets really difficult to visualize when the graphs starts to get big and complex. Let me rephrase, I suppose internally how the framework wants to store its config can be abstracted, so long as the visualization of it is not limited to editing XML. So if the framework do support other means of config visualization, it'll be good to include in the article as putting up XML configs really doesnt help in promoting the framework. Case in point, a simple 3 node state graph and you have almost a full page of XML. Just my 2 cents. Question time: 1. Can conditions be expressed via el? I suppose if it doesnt we can always implement our own facade condition that loads and parses el. But it'll be nice to have the framework support it out of the box. 2. Coupling to Spring. Can it easily be decoupled? Personally I dont think frameworks should be tightly coupled to other frameworks, this makes adoption difficult as existing applications may use similar frameworks. For example some existing application may use Guice for IOC already, and adopting this framework would then make the application use 2 different IOC frameworks which makes maintanence non-standard and messy.
  16. re: questions[ Go to top ]

    Regarding questions/comments that have come up in this thread: 1. decoupling from Spring. This can certainly be done. The main thing that Spring provides to Physhun is the bean factory -- this inflates the state model's classes at runtime from the XML defining the process model. It would be straightforward to write a non-Spring engine (implementation of com.wazeegroup.physhun.engine.StateEngine) and bootstrap the state engine from a non-spring bean factory. Physhun Modeler (the graphical editor) outputs Spring compliant XML, so if you were to do this you'd either have to develop a new modeling tool, or something to convert Modeler's output to a format that is compliant with the bean factory you choose. 2. Representation of the state model as XML. True, the XML representation of a state model can be extremely verbose. Frankly, any textual representation of a non-trivial state model is likely to be verbose and hard to visualize. This is why it is extremely useful to have a graphical editor. Physhun provides a graphical modeling tool which can be used to create, view and edit Physhun state models. In most scenarios you don't have to work with the raw XML. -Justin
  17. Hi I just want to know if this is similar to business process implementations like jBPM? If not how do they differ? Thanks y'all.
  18. Another question i have is that in your example for processobject persistence you used spring jdbc is it possible to use hibernate instead without any problems? I really like the simplicity of this product but one thing that is restraining me from using this framework in a production application is the apparent lack of a community around the framework and i am not sure where to go to if i run into problems. And again there dosent seem to be frequent releases as i can see it takes a long while for new releases to be made.
  19. There is something not right with tutorial example ( http://physhun.sourceforge.net/tutorial/tutorial.html ). You have: container.startProcess(sodaTx, stateModel); container.sendTriggerEventToProcess("mySodaTransaction", new soda.events.FundsAdded(0.1f)); // put in a dime but sending FundsAdded does not do what it's name implies (it does not add funds) because at that point the FSM in in the "New Transaction" state which has no actions associated with with moving out of that state. I am curious to see how would you change things to make the example work.
  20. Tutorial Example[ Go to top ]

    David - You are absolutely right -- since the condition for transition from NewTransaction to TransactionInProgress is defaultTriggeredCondition, after startProcess() returns the process state is indeed NewTransaction. The condition on transition from NewTransaction to TransactionInProgress should be DefaultCondition. If set as such, on return from startProcess() the process state would be TransactionInProgress. I need to update the tutorial example accordingly, thanks for the heads up! -Justin
  21. Similar Solution[ Go to top ]

    This is actually very very similar to something i've been working on and which i've described here (UML documents are located at the bottom of the page): http://www.javenue.org/process_framework/index.html There are quite a few differences between the two solutions though. It seems Pyshun is almost entirely XML-based while mine is purely java based. Additionally, it seem's the Pyshun solution is more tightly tied to specific technologies like Spring and the two databases they mentioned. They have also more distinctly defined conditions for executing transitions.
  22. Database dependency[ Go to top ]

    There is currently a dependency on Spring in that the default StateEngine (which can be overriden) uses the Spring BeanFactory to inflate the process model. However, there is absolutely not a dependency on the two mentioned databases. The persistence mechanism in Physhun is completely decoupled. You can implement and plug in whatever persistence mechanism you like. Although reference implementations for Oracle and mysql are provided, implementation of custom persistence mechanisms is extremely straightforward. The main reason that we went with an XML representation for the state models was so that processes could be modified or added on the fly without recompilation.
  23. Hi Justin, I downloaded the binary code and th sources, but I can not find where are the reference implementations for Oracle and mysql. ¿What do you mean with reference implementations?
  24. Persistence examples[ Go to top ]

    You can find samples of persistence support in the Examples package (separate download on sourceforge).
  25. methinks is good but...[ Go to top ]

    1)One should be able to create a new state machine model as a variation of an already existing model without duplicating the common definitions. 2)Conditions need to support an expression language
  26. methinks is good but...[ Go to top ]

    Using physhun, state models can be created as variations of others fairly easily by factoring common logic into reusable subprocesses, or simply by saving a model under a new name and modifying. As far as Conditions supporting an expression language, out of the box Conditions can be defined inline (without creating custom Condition implementation classes) in Java or in Groovy Script. So, yes, Physhun conditions (and Actions for that matter) do support expression languages. -Justin