3 Replies Latest reply on Mar 1, 2008 7:21 AM by Ronald van Kuijk

    re-assign actorId in task-assign event...

    stuart grassie Newbie

      Is there a better way to do this? I'm trying to assign the actor in a task-assign event in an ActionHandler, as so:

      1. Set the group of pooled actors using a swimlane. (Uses our custom expression assignment handler to fetch the users from LDAP).
      2. Create a process variable which contains a string containing the actorId to be assigned.
      3. On 'task-assign', go to the custom action handler and check that the actor id in the process variable exists in the group of pooled actors, and if so, set the actorId on the task instance.

      My problem here is that this then fires another 'task-assign' event, which then goes into the action handler again and sets the actorId again, and then... recursively does this until we stack overflow.

      I have tried using the 'task-create' event, however it seems that this gets fired before the expression assignment handler (so LDAP isn't queried for the pooled actors).

        • 1. Re: re-assign actorId in task-assign event...
          Michael Wohlfart Expert

          just my 2 cent:
          maybe I am missing your point, but in step 2 when you create the string with the actorId why don't you set the actorId directly on the swimlane and use the swimlane for the task?

          • 2. Re: re-assign actorId in task-assign event...
            stuart grassie Newbie

             

            "mwohlf" wrote:
            just my 2 cent:
            maybe I am missing your point, but in step 2 when you create the string with the actorId why don't you set the actorId directly on the swimlane and use the swimlane for the task?


            It's a business requirement that only the people in a certain group are allowed to do certain tasks. The particular group is specified as an expression in a swimlane, and our our custom expression assignment handler fetches the users in the group from LDAP, and assigns them as pooled actors to the task.

            Ideally what we'd like to happen is that users can see what tasks there are that they are allowed to do, and 'pick' them so that they are assigned to them; or, have those tasks assigned to them (step 2 in my original post).

            I've resolved the problem I had in my original post - I just put some simple logic in the action handler that ensures it never enters into a loop.

            • 3. Re: re-assign actorId in task-assign event...
              Ronald van Kuijk Master

              Can you make a unittest that demonstrates the original problem and one with your fix? Put the processdefinition inline as 'string-xml'