0 Replies Latest reply on Feb 16, 2006 12:13 AM by Brian Bulthuis

    EVENTTYPE_TASK_ASSIGN is fired before task is assigned

    Brian Bulthuis Newbie

      Hello,

      I need to run some code every time a task assignment changes, but I need the code to run after the new assignment has been made. I thought I could use an

      <event type="task-assign"><action class="com.mycompany.MyActionHandler"></action></event>


      in my jpdl task def, but the EVENTTYPE_TASK_ASSIGN is fired before the task assignment is made (see source for TaskInstance.setActorId(String, boolean)). For my purposes, I just changed this method so that the event is fired _after_ the task assignment is made, but I imagine that this in not the best way to accomplish what I want. It will certainly make it hard to upgrade my jbpm version!

      In the jpdl spec at http://docs.jboss.org/jbpm/v3/userguide/jpdl.html#task.element in the description of supported event types it states "Especially for the task-assign we have added a non-persisted property previousActorId to the TaskInstance". But the previousActorId property is not set until after EVENTTYPE_TASK_ASSIGN is fired either. So if it's not set until after the event is fired I don't understand why the property was added "especially for the task-assign".

      I fear that I'm missing something here and that there must be a way to fire an event after a task is assigned and I'm just not seeing it. Can anyone point out what I'm missing?

      Thanks!

      -Brian