We are creating a work-flow in which a submitted form-data needs to be approved by dynamic number of people based on the designation of user who submitted it. So if U1 has submitted a
form and there are 3 levels in between, before it goes to final approver U5, the workflow
should route it to U2 , U3 and U4 in sequence before it goes to U5. Now if U4 submits the form then it directly goes to U5 for final approval. So the number of approvers are decided by two factors 1) Designation on Submitter and 2) No of levels in between Submitter and Final approver.
The designation and id of Final approver(for a given submitter) is decided by companies policy and hierarchy. So if companies policy states that for a UnitManager the final approver has to be DepartmentManager, then the workflow should pass through all the levels in between and then reach the DepartmentManager.
How can we model such flow in Activiti. So far I have only modelled for fixed number of User tasks between start and finish. Do we need a looping over here ? So we create only 1 user task for approver and loop back to it for every approval until we reach the final approver ??