Hi, I have a listener listening to FlowableEngineEventType.TASK_ASSIGNED
event.
Below is a rough example of the custom listener:
TestListener.java
public class TestListener implements FlowableEventListener
{
@Override
public void onEvent( FlowableEvent event )
{
FlowableEngineEventType lEventType = (FlowableEngineEventType) event.getType();
switch( lEventType )
{
case TASK_ASSIGNED:
if( event instanceof FlowableEntityEventImpl
&& ( (FlowableEntityEventImpl) event ).getEntity() instanceof TaskEntityImpl )
{
TaskEntityImpl lTaskImpl = (TaskEntityImpl) ( (FlowableEntityEventImpl) event ).getEntity();
if( lTaskImpl.getAssignee() != null && lTaskImpl.getAssignee().equalsIgnoreCase( "TEST" ) )
lTaskImpl.setAssignee( "ADMIN" );
}
}
break;
default:
break;
}
}
//other inherited method implementations
}
With this lTaskImpl.setAssignee( "ADMIN" );
I’m able to change the assignee for the given user task
from “TEST” user to “ADMIN”. But I get the old Assignee value i.e. “TEST” for the custom history APIs, which try to retrieve data from table act_hi_actinst
List<HistoricActivityInstance> historyList = mHistoryService.createHistoricActivityInstanceQuery()
.processInstanceId( processInstanceId )
.orderByHistoricActivityInstanceEndTime()
.desc()
.list()
Is there a way I can change the data of the history table as well while changing the assignee in TASK_ASSIGNED event?.