I do not have the time now, but tonight I will give you a promissing response
Some more detail on the problem..
After a little more thought I am wondering whether it is worth the extra effort to integrate with spring webflow at all. It occurs to me that there is a lot of cross functionality with jBPM. Spring webflow appears to me like a small session persitence only BPM that doesn't allow for multiple paths of execution. I was originally contemplating it as I suspected more than one view might be required per stage in a process but actually I believe now this could be implemented by just having more nodes in a process graph. My process graphs might end up a little more complicated but that just provides more diagramatic documentation without any extra work so is a pro rather than con!
Now I believe mapping a view to each token would achieve the same result without extra complexity of integrating with yet another product and the result more powerful anyhow. This would allow building of composite views out of the sub-views mapped to each token that represents the current ongoing state of the process instance.
If each process instance is "owned" by the user (easily implemented as a variable of the process instance) that instantiated it then it is a simple matter to retrieve the currently selected view tree representing where the tokens currently are waiting. The user can easily flip between their currently running processes and these persist across login sessions very easily. No problem with server crashes or leaving half finished work till the next session.
Another concern is how to map Tasks to views. This is more difficult as tasks may be assigned to other users or unassigned and so don't directly relate to the user who currently "owns" the process. So these don;t fit so neatly into a representation hierarchy as the tokens seem to. However, the "owner" would probably want to be able to view the state of the tasks even if they are waiting for another assigned user to complete the task. Another problem with Task is that it may involve a more complex GUI flow itself which is what originally gave me the idea of mapping jBPM objects to Spring WebFlows. It could be broken down into more nodes with only one Task but this is not taking advantage of the jBPM engine fully and limits the user to perfoming tasks in a prespecified order. The thing I like about tasks is that they can be completed in whatever order the user thinks most appropriate at that moment and that the token continues on its travels when they have all been signalled as done.
I think there is some real potential here for a very powerful web framework on top of jBPM but need to think through how views map to relevant jBPM objects..
Thanks for any comments and suggestions in advance..
I just came home from and have to admit I should not write a detailed answer anymore ;-). I owe you one..... so you have to wait until tomorrow (friday)
Your contemplation is very right. We already thought about using jBPM as a pageflow framework more than one year ago during one of our projects, but the idea was buried because of a lack of time. However, it became alive again some time ago in the context of the JBoss Seam project. I will not explain Seam here, suffice to say that it is a framework bringing together JSF, EJB3 and process flows. You might want to read about it on the Seam homepage. One of the next steps of Seam is to use jBPM not only as the engine to drive the business processes, but also as the navigation engine for the web pages of the application. There is already an implementation that allows this in cvs. Have a look at the test and at the implementation.