# Flowable Task Listener

**URL:** <https://forum.flowable.org/t/flowable-task-listener/5173>\
**Category:** Flowable Engine\
**Created:** [January 4, 2020, 10:48am UTC](https://forum.flowable.org/t/flowable-task-listener/5173 "2020-01-04T10:48:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamraoui](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mamraoui](https://forum.flowable.org/u/mamraoui)\
**Post date:** [January 4, 2020, 10:48am UTC](https://forum.flowable.org/t/flowable-task-listener/5173/1 "2020-01-04T10:48:28Z")

</div>

Hello,  
I use a TaskListener to change the assignee of the task at create event.  
the assignement works but after going to the next task the assignement of the previous task is lost and going to the original assignement value.

TaskListener  
public void notify(DelegateTask delegateTask) {

```
	// TODO get dynamicly the first validator for the owner. 
	delegateTask.setAssignee((String) delegateTask.getVariable("assignee"));

	//task.setAssignee((String) delegateTask.getVariable("assignee"));
	delegateTask.setVariable("assignee", delegateTask.getAssignee());

	// Assign the owner of the task
	delegateTask.setOwner((String) delegateTask.getVariable("owner"));
	
}

```

In addition , the changing of the owner is not taked at all

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [January 6, 2020, 9:43pm UTC](https://forum.flowable.org/t/flowable-task-listener/5173/2 "2020-01-06T21:43:18Z")

</div>

That is very strange - it should set the assignee from the variable.

> [@mamraoui](#):
>
> but after going to the next task the assignement of the previous task is lost

How do you mean? At that point the first task is completed and is removed. Or do you mean in the history task counterpart?
