4 Replies Latest reply on Mar 9, 2012 9:49 AM by Ryan Peterson

    How to model human-task with sub-employees

    Ryan Peterson Newbie

      Hi guys,

       

      I'm trying to figure out the best way to model the following workflow:

      Starting from the top down (let's say CEO), an employee is responsible for submitting a review for their direct employees.  Once the  review is submitted, that employee is responsible for reviewing their employees.  This behavior should repeat until the entire tree of employees within the company is traversed.

       

      I've studied the "Evaluation" example, and this is similar to the behavior I need, except it's not dynamic.  It's fixed for a specific number of required reviews.  I have also looked into MultipleInstance, that runs a sub-process once for each element in a collection, which is also similar to what I need, except each sub-employee must wait until their subervisor completes their review before being allowed to review the next level of employees.  Say for instance a notification is sent when the CEO should review his/her employees, once those reviews are done the next level of employees receive a notification that they need to review their employees, etc.

       

      If anyone has any suggestions how to model this within jBPM5/BPMN I'd really appreciate it!

        • 1. Re: How to model human-task with sub-employees
          Maciej Swiderski Master

          Hi Ryan,

           

          Have you considered to build arbitrary loop in your process?

          sub-employees-process.png

          You would have gateways that will control if there is a need to continue looping and if so additional task responsible for assigning new reviewers. If needed you can combine it with multiinstance capability for Perform Review task if there are number of reviewers that can to their work in parallel.

           

          What do you think about it?

           

          Cheers

          1 of 1 people found this helpful
          • 2. Re: How to model human-task with sub-employees
            Ryan Peterson Newbie

            Thank you for your reply Maciej!

             

            That's sounds very close to solving my issue, my only point of concern is the behavior at "Assign New Reviewers":  Will jBPM spawn off new processInstances for each sub-employee?  For example if a manager has two employees, and they each have three employees:

             

            1.  The manager performs the review of his employees

            2.  Somewhere a check is made to see if the manager's employees have employees

            3.  Yes they do, Assign the new reviewers

            At this point here, how does the processInstance go from a single instance for the manager, to two instances for the manager's employees?  This is necessary because each sub-employee will complete a review on different schedules, and each needs to be checked individually for sub-employees after the manager's reviewing is complete. 

            Is it possible to start a new process, or call an external process from a previously started process?

            From the examples I've read it seems like a sub-process might be the key here, I'm just not quite sure how to get the behavior I'm looking for.

             

            Thanks again!

            • 3. Re: How to model human-task with sub-employees
              Maciej Swiderski Master

              I meant to have single process instance but multiple instances of human task that is assigned to review. So, in that case iteration of the loop will be for a level in a hierarchy of employees. That could mean there will be only one employee responsible for review (at CEO level) or there could be number of employees (at lower levels).

              In first case (CEO), there will be single instance of Perform Review human task that will prevent of going further unless review was completed. Next assign new reviewers will be responsible for looking into some service to get list of downstream employees responsible for review (and that could be more than one) and will start new iteration. Perform review should be multipleinstance node that can create any number of instances of that human task and assign to every reviewer from given collection. Again all employees on the same level can work in parallel with their tasks. I think process instance will wait for all employees on given level to finish their tasks before new iteration will start - is that acceptable in your case?

               

              HTH

              • 4. Re: How to model human-task with sub-employees
                Ryan Peterson Newbie

                Thanks Maciej, that sounds like the way to go.  For anyone else that finds this, Esteban has an example of multiple-instance nodes made up already: https://github.com/esteban-aliverti/JBPM-Samples/tree/master/Multiple-Instance-Node-Samples

                 

                I'll report back with the solution once I get it all figured out.