Process modeling question
bradtwurst May 11, 2006 12:40 PMHello all,
I am fairly new to jBPM, but I've gone through the user guide, the getting started wiki page, and the various workflow pattern tests. These items have provided me with a decent overview of how jBPM works, but I am still having troubles grasping how various 'real-world' situations should be modeled within jBPM.
I would greatly appreciate any suggestions that can be provided.
Maybe I should give an example scenario of a problem that can be a point of discussion.
----------------------
There is a shipping department for a bookstore. The department receives orders that must be fulfilled.
Now, this shipping department is not the most streamlined and organized department and, right up to the point that an entire order gets loaded onto the truck for delivery, the department can change the makeup of a shipped order. For example, maybe there is a more important customer that needs a book instead of the current customer, or someone decides to repack the boxes for an order due to weight limits per box.
In this example, I have been given the task of not only telling the company what was shipped, but to also track the intermediate changes that occurred as books and/or boxes were added/removed to a specific order. This information will be later analyzed by the shipping supervisor in valient efforts to improve the department. Also, I will be receiving these events via a soap service from a third-party application, so there isn't any 'direct' user interaction with the process. There are also multiple orders in 'the system' at once, so I'll need to locate the correct task for the correct order.
--------------------------
So, I believe that I have a process that:
* has multiple internal (packing/unpacking) events
* all events that could occur are known at design time
* the effect of each event is known at design time
* there is no specific predefined order for these events
* however, the actual order of runtime events must be maintained
* ex: a specific book must be removed from one box before it is placed in another
* a specific event type can occur multiple times
* but each event occurance is unique
* ex: multiple boxes are added to an order at various times
* can continue until an external event (placing order on delivery truck) occurs
----------------------
That's the example. I am having trouble determining the best way to approach a solution. Here's my first attempt.
-----------------------
I have a wait node that is basically "Waiting for next step".
This node then has a seperate transition for each packing/unpacking event that may occur.
Each transistion points to another corresponding task-node (add box to order, add book to box, remove book, remove box, etc) where the message would provide specific information about that task.
Each of these task-nodes would then transition back to the 'waiting for next step'. There would be an action on the transistion event that would update the order/box/book database with the changes.
Then, I see another transition from the "waiting for next step" that would be "order placed on truck" that would end the specific process instantiation (for that order).
--------------------
Then I thought some more and wondered if this was the correct way to model the above example.
For example, instead of having a 'waiting' step that then steps into a second task, would it be better to have one task-node with multiple tasks (continue set to "first") where the user can provide information and then have the transition (with the associated action) deliver the flow directing back to the first task?
Does the above example fit specific workflow patterns? I sort-of see that 15 (MI w/o RT Knowl.), 17 (interleaved parallel routing), and 18 (milestone) fit the scenario. Any thoughts?
--------------------
I am also having some difficulty understanding how to best deal with issues of granularity. For example, do I try to keep all tasks at the level of a book? a box? an order? Or does it really matter?
Thanks for your patience in this long post,
James