On Wed, Jun 30, 2010 at 01:57:46PM +0200, Gonzalo Suarez wrote: > > I have some doubts about how should I use the persistence of a > business process.
Wow, I was afraid : your title, when read quickly, feels like "I doubt that the engine is persisting". > As far as I understand, a workflow engine is a piece > of software that provides you with a way to model the logic of a > process. Say you have a process that models the creation of a > document: > > 1. The document is created by A. > 2. Then two reviewers (B and C) get a copy and add some comments. They > also give it a rate (0 to 10 points). > 3. Then a process calculates the rate average. If rate > 5.5, the > document along with the two comments are published on a DB. If not, go > back to step 1. > 4. Finally person D gets informed by email. > > Every step implies that the document is in a certain state. I also may > have many other documents in my DB. I may like to query, for example, > a REST web service for documents that have been published or that have > been published and revised. > > But here is the problem. Some documents are in the workflow. > Some other are in the DB. Should I save the document to the database at > some point during the workflow? If I do that, I should record the > state? Is it better to query the workflow and the DB independently and > then join the results? > > I find myself doing REST things like this: > > GET /documents/?author=john&state=reviewed > > but I don't know if state should be an attribute for the entity/model > document (like author or id are), or I just should leave that info in > the workitem (workflow). > > Have you faced this problem before? If so, what solution did you choose? > Many thanks in advance for sharing your thoughts. > Best regards. I'm facing this challenge every day. Documents and entities are in various states. The business processes circle around them and change their state and take different routes based on the state of an entity or of a group of entities. This step participant :ref => 'publisher', :task => 'publish reviewed documents' or publish_reviewed_documents could leverage your GET /documents/?author=john&state=reviewed the step would gather all the documents that are in state reviewed and then publish them in batch. If you separate the entity lifecycles from the business processes you can go a long way. Pasta are cooked or not. (2 states) The recipe says "take the pasta, put them in boiling water for 10 minutes, then serve on a plate". (3-4 steps) Further questions are welcome, -- John Mettraux - http://jmettraux.wordpress.com -- you received this message because you are subscribed to the "ruote users" group. to post : send email to [email protected] to unsubscribe : send email to [email protected] more options : http://groups.google.com/group/openwferu-users?hl=en
