Have you looked at www.workflowpatterns.com? Is pattern 16 (Multiple instances without a prori runtime knowledge) the pattern you need? If so, look at the testcases of jbpm. There is an example, Wfp16MiWithoutAPrioriRuntimeKnowledge.java, which demonstrates this.
Yup! That's exactly what I am referrng to. You are on the ball!
Thank you Ronald. I will look at the testcase.
Ronald, you definately pointed me in the right direction, but now I'm confused when I'm looking at the test cases.
In all reality, my scenario is actually Patern14 (Multiple Instances with a priori runtime knowledge).
In other words, I will be using a FOR loop to loop through and create the tasks, rather than a while loop. Which means, that the tasks varies from the process definition, but I will know how many tasks to create prior to the transition 't' (before leaving state 'b').
However, I'm looking at the testCase for pattern14, but the testcase is not testing pattern14. It's just testing a standard process definition. Pattern 14 states the number of tasks varies, correct? (i.e. creating tasks based on a FOR loop). But, the testcase only tests the tasks defined in the process definition.
pattern 14 states the number of tasks is nowm design time. Therefor a fixed number of tasks is in the node. It is not a 'default' process since there is more than one task in the tasknode.
pattern 15 uses a for loop which gets it's 'number' from e.g a process variable.
In the testcases only one actor is there. If you want them assigned to different users, you have to extend the code a little.