13 Replies Latest reply on Jul 6, 2007 12:17 PM by kukeltje

    process instance and groups

    ricardomarques

      Hi guys

      Continuing a bit the problem in this topic: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=73247
      but not quite.

      i have this process definition piece:

      <start-state name="enter request">
       <task name="request entry">
       <controller>
       <variable name="start date" access="read,write,required"></variable>
       <variable name="duration" access="read,write,required"></variable>
       </controller>
       <assignment expression="group(users)"></assignment>
       </task>
       <transition name="" to="evaluate request"></transition>
       </start-state>
      


      and this instanciation code:

      cmd = new NewProcessInstanceCommand();
      cmd.setProcessId(Long.parseLong(pid));
      cmd.setActorId(userName);
      cmd.setCreateStartTask(true);
      
      getEngine().execute(cmd);
      


      both user grover and ernie belong to "users"

      if I log as grover or ernie and initiate a process instance, the first task goes to that user tasklist.

      The behavior that i was expecting was that, that task instance appears on group "users" task list.

      I'm creating the instance the right way, or for that behavior something must change?

      any feedback would be usefull :)

      thanks

        • 1. Re: process instance and groups
          kukeltje

          group assignments do not work for start tasks afair, but I could be wrong.

          • 2. Re: process instance and groups
            syngolis

            You are right. The first task is assigned to the initiator. No other assignments are possible.

            • 3. Re: process instance and groups
              kukeltje

              file a jira issue for this behaviour to be changed.. give it low priority and assign it to 3.3 (but it still could be rejected)... there is a workaround I think to after the start, re-assign it. Not sure if that works

              • 4. Re: process instance and groups
                syngolis

                A workaround could either be a nodeenter-event in start-state with an actionhandler. But I didn't test that. So i am not sure...

                In my opinion, it is the correct behaviour of an workflow management system. If an initatior starts a workflow, usually he has to set some parameters for the workflow to process. But at least the possibility to create an other behaviour in some cases would be good.

                I'll create the jira later.

                • 5. Re: process instance and groups
                  ricardomarques

                  Don't have sure that's the correct scenario, but the one who creates an instance could be different from the one who works on it.

                  If there is a jdl feature for this on process design it should be available on the engine level.

                  Or not..


                  syngolis, can u later post here the url for the jira issue please, i want to follow that :)

                  • 6. Re: process instance and groups
                    syngolis
                    • 7. Re: process instance and groups
                      ricardomarques

                      btw continuing a bit my saga. The same process, now the full version:

                      <start-state name="enter request">
                       <task name="request entry">
                       <controller>
                       <variable name="start date" access="read,write,required"></variable>
                       <variable name="duration" access="read,write,required"></variable>
                       </controller>
                       <assignment expression="group(users)"></assignment>
                       </task>
                       <transition name="" to="evaluate request"></transition>
                       </start-state>
                       <end-state name="end"></end-state>
                       <task-node name="evaluate request">
                       <task name="entry evaluation">
                       <controller>
                       <variable name="start date" access="read"></variable>
                       <variable name="duration" access="read"></variable>
                       <variable name="info" access="read"></variable>
                       <variable name="decision"></variable>
                       </controller>
                       <assignment expression="group(users)"></assignment>
                       </task>
                       <transition name="More info needed" to="give addition info"></transition>
                       <transition name="approve/disapprove" to="end"></transition>
                       </task-node>
                       <task-node name="give addition info">
                       <task name="additional info entry">
                       <controller>
                       <variable name="start date" access="read"></variable>
                       <variable name="duration" access="read"></variable>
                       <variable name="info"></variable>
                       </controller>
                       <assignment expression="group(users)"></assignment>
                       </task>
                       <transition name="" to="evaluate request"></transition>
                       </task-node>
                      


                      After I do the work on start task, i move on to another node (task), that node is assign to a group, still i don't get the not either on the user task list or the group task list.

                      I'm getting the group task list like this:

                      ArrayList list = new ArrayList();
                      list.add(this.username);
                      
                      return jbpmContext.getGroupTaskList(list);
                      


                      thanks in advance

                      • 8. Re: process instance and groups
                        petia

                        An idea: check the spelling of the group. You use plural form. In version 3.2.1 there is a predefined group called user (singular form).
                        If it does not work test

                        This worked in version 3.1.2, unfortunately only if there was one member defined with the specified member/role. It did not worked if there were several members in the group with the same role (i.e. the member part of the expression above). The assignment data was stored in the database, but the web interface did not support the pooling of offered tasks by the user.
                        Good luck! I am interested in the same issue and if you get group distribution working I will appreciate if you could share your solution.
                        Kind regards, Petia

                        • 9. Re: process instance and groups
                          petia

                          Sorry, I have problems with writing xml code in my posts. They appear when I am writing, but not in the posted text. Below is the xml snippet I suggest to be tested in the previous post. It is an assignment expression.

                          group(groupname) -> member(rolename)

                          • 10. Re: process instance and groups
                            ricardomarques

                            I get an error trying to do that: org.jbpm.graph.def.DelegationException: couldn't resolve assignment expression 'group(users)->member(team leader)'

                            PS: i'm looking at the database, there is no another group users.

                            • 11. Re: process instance and groups
                              syngolis

                              You have to write the pointer with two '-' like this:
                              group(users)-->member(team leader)

                              See documentation http://docs.jboss.com/jbpm/v3.2/userguide/html/taskmanagement.html#assignment

                              • 12. Re: process instance and groups
                                ricardomarques

                                OK it works now, but still i don't wanna define memberships to all my users, so for the behavior that i want, what's the best aproach?

                                • 13. Re: process instance and groups
                                  kukeltje

                                  I have no clue what "the behaviour you want' is....