11 Replies Latest reply on Feb 18, 2009 9:20 AM by kukeltje

    task and swimlane roles

    tom.baeyens

      heiko,

      i'm splitting the user and group roles. does this look ok to you ?

      public enum RoleType {
      
       USER,
      
       GROUP
      
      }



      In TaskService:

      /** add a role to a given task.
       * @param roleType identifies if this is a user role or a group role
       * @param refId identifies the user or group
       * @param role specifies the role that the user or group fullfills for this task. */
      void addTaskRole(long taskDbid, String refId, RoleType roleType, String role);
      
      /** get roles related to a given task.
       * @param roleType if not null it will filter the roles
       * @param role if not null it will filter the roles */
      List<UserRole> getTaskRoles(long taskDbid, RoleType roleType, String role);
      
      /** removes a role to a given task. Nothing happens (no exception) if
       * the role does not exist.
       * @param roleType identifies if this is a user role or a group role
       * @param refId identifies the user or group
       * @param role specifies the role that the user or group fullfills for this task. */
      void removeTaskRole(long taskDbid, String refId, RoleType roleType, String userRoleType);
      


      then the same methods for associating roles with swimlanes

      void addSwimlaneRole(long taskDbid, String refId, RoleType roleType, String role);
      List<UserRole> getSwimlaneRoles(long taskDbid, RoleType roleType, String role);
      void removeSwimlaneRole(long taskDbid, String refId, RoleType roleType, String userRoleType);


      does this make sense in the context of the discussions we had about it ?

        • 1. Re: task and swimlane roles
          tom.baeyens

          i'll take this rout for this iteration. let's evaluate after the release.

          • 2. Re: task and swimlane roles
            heiko.braun

            Although I understand what you describe I always stumble across the word "Role". It seems to be abused in this context. "User,Group and Role" are commonly used in conjunction and have a particular meaning. Now when I read RoleType==User it get's really confusing to me.

            I need to think about a different proposal, but I hope it explains why I have difficulties with the current naming.

            But besides that just a few comments:

            * We could simplify the API by joining RoleType and role into one entity:

            RoleAssociation:
            {
             type;
             role;
            }
            
            void addTaskRole(long taskDbid, String refId, RoleAssociation assoc);
            
            


            * I am missing the finders, i.e. TaskService.getTaskForRole(...)




            • 3. Re: task and swimlane roles
              heiko.braun

              BTW, what's the refId?

              • 4. Re: task and swimlane roles
                heiko.braun

                To further explain the unification of type and role into one entity, look t the example below:

                As is

                TaskService.addTaskRole(73, "123-CallHome", RoleType.USER, "Heiko");
                


                Could be
                TaskService.addTaskRole(73, "123-CallHome", new UserAssociation("Heiko"));
                


                with

                
                class UserAssocation extends/implements RoleAssociation
                {
                 type = RoleType.USER;
                 role;
                }
                
                


                • 5. Re: task and swimlane roles
                  tom.baeyens

                  so the 2 options are:

                  long taskDbid = ...;
                  
                  taskService.addTaskRole(taskDbid, IdentityType.USER, "johndoe", Role.ROLENAME_CANDIDATE_USER);
                  

                  or

                  long taskDbid = ...;
                  
                  taskService.addTaskRole(taskDbid, new User("johndoe"), Role.ROLENAME_CANDIDATE_USER);
                  


                  where

                  public interface Identity {
                   getId();
                  }
                  
                  public class User implements Identity {
                   public User(String userId) {...}
                   ...
                  }
                  
                  public class Group implements Identity {
                   public Group(String groupId) {...}
                   ...
                  }


                  both are acceptable to me. but working with objects in a session facade can lead to confusion. so i am leaning a bit more towards first option with identityType = IdentityType.USER and identityId = "johndoe"

                  WDYT ?

                  do these 2 options reflect the choice correctly ? or do you see other diffs as well ?

                  • 6. Re: task and swimlane roles
                    heiko.braun

                    Recent chat between tom and heiko


                    Tom
                    ----------------
                    or can that property of the stakeholder be called role ?

                    then we do not have the same confusion as we had before

                    Heiko Braun
                    ----------------
                    right, we are looking fot the property of a stakeholder

                    that's what I call the verb

                    a user or group may be a stakeholder

                    but it doesn't specify their involvement

                    Tom Baeyens
                    ----------------
                    what about just keeping the term role for that property ?

                    Heiko Braun
                    ----------------
                    participant and participation is not too bad

                    USER johndoe PARTCIPATES as CANDIATE

                    i like this:

                    taskService.addParticipant(taskDbid, new User("johndoe"), Participation.CANDIDATE);

                    Tom Baeyens
                    ----------------
                    yes


                    • 7. Re: task and swimlane roles
                      heiko.braun

                      Another example

                      TaskService.addParticipant(taskDbid, new User("3rd party"), Participation.FINAL_RECEIPIENT);
                      


                      • 8. Re: task and swimlane roles
                        heiko.braun

                        Participation.CANDIDATE would be a pretty generic one. maybe it's enough to get started.

                        • 9. Re: task and swimlane roles
                          camunda

                           

                          Heiko wrote:

                          Although I understand what you describe I always stumble across the word "Role". It seems to be abused in this context. "User,Group and Role" are commonly used in conjunction and have a particular meaning. Now when I read RoleType==User it get's really confusing to me.

                          Why not keeping the term "actor" which did the job well in jbpm3? And doesn't lead to the confusion Heiko described...

                          • 10. Re: task and swimlane roles
                            tom.baeyens

                            actor actually relates to what we now call an IdentityRef: a reference to a user or a group (this is now typed: UserRef and GroupRef inherit from IdentityRef)

                            basically the participant is a generalization of the pooled actors in jbpm 3. pooled actors were candidates. now we have other forms of participantion as well: candidate, owner, viewer, client, and so on.

                            • 11. Re: task and swimlane roles
                              kukeltje

                              I will come up with a more detailed response later, but why not
                              take terminology from
                              http://www.workflowpatterns.com/patterns/resource/resource_modelling.php

                              or maybe from ws-ht?

                              Creating our own terminology is imo not the way to go.