5 Replies Latest reply on Jan 13, 2012 10:47 AM by jemmerling

    Human Task Assignment -- restrict based on process variables

    jemmerling

      Again, I am not proud of the subject line but here is the question:

       

      In general, I want to associate a node or task with a group -- however, subject to some additional restriction.

       

      Using the term "task list" to refer to the set of tasks that an actor may claim, I would like a task to NOT appear in an actor's task list even if the actor belongs to the group associated with the node, based on some additional rules involving the state of the process i.e. its variables.

       

      In particular, there is a rule that I need to enforce that an actor cannot claim a task if they completed some previous task -- in other words, for a given process instance, 2 tasks in particular must always be completed by different actors even if both actors qualify in general to claim a task associated with either node. Of course, many other such rules could be defined, but that is a concrete example that concerns me at the moment.

       

      One reason I ask is because another product I have investigated (i.e. YAWL) does explicitly support such rules IIRC.

       

      To put things in perspective, there are other ways I could achieve this objective however they would be outside jBPM5 e.g. a client app that removes tasks from the user's "view" of the task list according to such a rule. But I would prefer to do this within jBPM5 out of a desire to maintain all business rules in one place (well I suppose the hypothetical client could share the knowledge base with jBPM5).

       

      Thanks!

       

      --JE

        • 1. Re: Human Task Assignment -- restrict based on process variables
          garys

          I have the same requirement (                              Re: How do I exclude User in a swimlane                     ). For my project, performing a task in the same role by a different user is an essential requirement.

          • 2. Re: Human Task Assignment -- restrict based on process variables
            jemmerling

            Gary,

             

            It seems the concept of potentialOwner and excludedOwner are both addressed in the WS-HumanTask specification but not in the BPMN2 specification (it only addresses potentialOwner).

             

            I don't know whether jBPM5 has the potential to extend BPMN2 or has already done so.

             

            Nor do I know whether this is information you didn't already have.

             

            Does anybody know if the above information suggests a generic way to access this? In my case I am not specifically concerned with swim lanes if that makes any difference.

             

            --JE

             

            • 3. Re: Human Task Assignment -- restrict based on process variables
              jemmerling

              OK,

               

              I believe I have at least partially answered this question for myself.

               

              From looking at code, it appears to me that most logic associated with with "task assignment" is in org.jbpm.task.service.TaskServiceSession.

               

              So it appears that the method executeTaskAddRules has the purpose of allowing the developer (or analyst?) to define any rule he or she wants using any content they have defined. So, for example, if you have a process consisting of two approval steps, and you want to define a rule that states that an the actor that completed the first approval step may not be assigned the second approval step (even if both actors, in general, are eligible to perform that step) you would simply keep track of whatever actor approved the first step then define a rule that prevents that actor from being assigned to the second step.

               

              Note that this method is one of the few in jBPM5 that I have encountered so far which has any JavaDoc, so I am guessing it's an important method to understand.

               

              Taking note of the fact that this method throws an exception when a rule is violated, I need to investigate further to determine how to leverage this functionality in such a way that the routine application of a rule does not case a user to experience an error message.

               

              If somebody can confirm that this is the correct general approach, please reply and I will update this thread to "Answered". Also if you know of any example for implementing such a rule, please point me to it, if you don't mind, thanks!

               

              --JE

               

              P.S. I recognized after initially posting this, that my concern is with adding a task to a list of tasks that a user may claim, not with directly assigning a task to a user. I have not yet identified where in the code where this logic is performed.

               

              Message was edited by: John Emmerling

              • 4. Re: Human Task Assignment -- restrict based on process variables
                jemmerling

                Never mind -- this looks like a dead end.

                • 5. Re: Human Task Assignment -- restrict based on process variables
                  jemmerling

                  If interested, please look at my post from today entitled "Proposed temporary and limited approach to supporting excluded owners" for a possibly solution to this problem.