the way you modelled the process seems fine.
afaik, you wouldn't need two variables. you would need to customize the UI to show your hierarchical task list.
Ok, I'll rephrase my question somewhat.
When I got my processinstance running I don't see how I can visualize the different levels of the process. The idea was to present the user with a treegrid with different indentation for each level but how do I know to which "phase" a particular task belong to.
Pseudocode for what I would like to accomplish:
For the current instance:
loop the different phases (how? the are represented by forks)
for each phase loop the different groups
for each group loop the tasks
I guess I could follow the start-state to the first fork and then follow the transitions or something like that.
I forgot an additional problem.
The end uses want to be able to plan their phases, ie, to set a dueDate on a phase.
Only solution I can come up with is to add a task at the end of each phase and let the user set dueDate on that...