cancel
Showing results for 
Search instead for 
Did you mean: 

Incomplete/Incorrect TaskEntity from ActivitiEntityEventImpl?

kingsheldor
Champ in-the-making
Champ in-the-making
I created an extension of your BaseEntityEventListener and am overriding the onCreate() method.  When I have a new task, it is correctly sending me the ActivitiEntityEvent, from which I am getting the TaskEntity.  However the TaskEntity is not fully populated.  For example it has a null assignee, processInstanceId, name, etc.

Furthermore, when I use the TaskService to get the fully-populated task (using the processInstanceId from the ActivitiEntityEvent), I found that they have different ids.  Why does the TaskEntity from the TaskService query have an id of 308 while the TaskEntity from the event have an id of 502?  Which one is correct?
14 REPLIES 14

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

That's true.

the reason for it is that

  public void execute(ActivityExecution execution) throws Exception {
    TaskEntity task = TaskEntity.createAndInsert(execution);

// setting task attributes

    // All properties set, now firing 'create' events
    if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
      Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(
        ActivitiEventBuilder.createEntityEvent(ActivitiEventType.TASK_CREATED, task));
    }
}

ENTITY_CREATED is fired in TaskEntity.createAndInsert(execution); and TASK_CREATED is fired attribute update.

Do you have any test that creates the listener in process engine configuration and reports on the event entity as soon as the event is fired?
No.

Regards
Martin

awhobbes
Champ in-the-making
Champ in-the-making
Hi Martin,
I'm working with Mr. Bean (above), and I know he's pulled and built the code so that he can see the TASK_CREATED events.  I'm specifying 5.16 as the version but can't see this.
  
I can use the jars he's created but that means changing the names of all of them to something like activiti-bpmn-model-5.16-DEVBUILD so that I can force my code to pick up his jars.  

I was wondering if you're going to have a release soon in 5.16 which will incorporate TASK_CREATED.
Thanks,
Axel

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Axel.

TASK_CREATED will be part of 5.16 - release was postponed (plan was to have the release on 18-th of June).

Regards
Martin

awhobbes
Champ in-the-making
Champ in-the-making
Hi Martin,
Great, thanks.
What's the current plan for the 5.16 release?
Axel

jbarrez
Star Contributor
Star Contributor
Somewhere end of July. Have to finish up quite a bit of stuff for this release (event logging)