-
1. Re: Relationship Between Pageflows and Process Definitions
dan.j.allen Jun 10, 2008 3:25 AM (in response to darthmaul)Pageflows and business processes are two distinct concepts. A pageflow only has the visibility of a single user and even then is transient. The best way to think of it is as a
managed
conversation. To get any indication of progress of a process you need a business process. The jBPM API can give you a tremendous amount of information about the state of a process. In fact, jBPM is built on Hibernate, so you can query the tables directly if you feel like the API is not serving you well.As for driving the business process, Seam has @CreateProcess, @ResumeProcess, @BeginTask, and @EndTask that work similarly to the conversation annotations. In fact, you can work on a task, start a page flow, and start a long-running conversation all with @BeginTask.
-
2. Re: Relationship Between Pageflows and Process Definitions
darthmaul Jun 10, 2008 7:56 AM (in response to darthmaul)Thanks, Dan, for the insight. I am still not sure though how the two can work together. In the scenario I described, would I then simply have two tasks? One for the sales staff and one for the shippers since each will have a pageflow associated with it?
Basically, when I get to the page that kicks off the order processing by the sales staff, it seems to me I should do both @CreateProcess and @BeginTask(pageflow="salesOrderPageflow"), which is the pageflow I have working now. Then I will do an @EndTask when the sales staff confirms the order. All the while, the order component is saved to the business process context. Similarly, I will do @BeginTask(pageflow="shippingOrderPageflow") on the page that kicks things off for the shippers and do an @EndTask when they have sent the package off.
The fact there are only two tasks worries me that I misunderstand the notion of a
task.
With my current understanding, each task is a pageflow. Does my description sound reasonable?By the way, I have been following the progress of your book closely, and I am really looking forward to its publication.
Thanks.
-
3. Re: Relationship Between Pageflows and Process Definitions
darthmaul Jun 17, 2008 9:35 PM (in response to darthmaul)Here is an example of the issue I am having resolving where one process flow ends and another begins:
First, my pageflow:
<start-page view-id="/sales/beginOrder.jspx" name="beginOrder"> <description>Begin Order</description> <redirect/> <transition name="shop" to="shop"/> <transition name="backToConfirmation" to="confirm"/> </start-page> <page view-id="/sales/shop.jspx" name="shop"> <description>Shop</description> <redirect/> <transition name="addToOrder" to="shop"> <action expression="#{orderAction.addItem}"/> </transition> </page> . . .
Then my process-definition:
<start-state name="start"> <transition to="beginOrder"/> </start-state> <task-node name="beginOrder"> <task name="beginOrder" description="Begin Order"> <assignment actor-id="sales"/> </task> <transition name="shop" to="shop"/> <transition name="backToConfirmation" to="confirm"/ </task-node> <task-node name="shop"> <task name="shop" description="Shop for SRM's"> <assignment actor-id="sales"/> </task> <transition name="addToOrder" to="shop"> <action expression="#{orderAction.addItem}"/> </transition> </task-node> . . .
As you can see, I am finding that I am repeating myself. This smells bad to me, so I am sure that what I am doing is redundant. Is this so? How do I get the two to mesh? For example, do I state the same transitions in both but specifiy the actions associated with those transitions only in the pageflow?
Any insight is appreciated.
Thanks.