AnsweredAssumed Answered

CompleteListener can not find now task data from act_hi_taskinst table, have solutions?

Question asked by nova on Apr 11, 2016
Latest reply on Apr 20, 2016 by jbarrez
Hello everyone, I met a problem:I want to get the task end-time(act_hi_taskinst END_TIME_) by CompleteListener, but CompleteListener can not find now task data from act_hi_taskinst table.

The  specific  content:


    // complete task method
    @Transactional
    public void saveAndComplete(TaskService taskService, Model entity,String taskId, Map map) {
        modelDao.save(entity);
        taskService.complete(taskId,map);
    }


<xml>
    <!– complete Listener config –>
    <userTask id="step2" name="send to leader" activiti:assignee="${applyUser}">
      <extensionElements>
        <activiti:taskListener event="complete" delegateExpression="${superviseListener}"/>
      </extensionElements>
    </userTask>
</xml>


// my completeListener
@Component
@Transactional
public class SuperviseListener implements TaskListener {

    protected Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    protected SuperviseManager superviseManager;

    @Autowired
    protected ModelManager modelManager;

    @Override
    public void notify(DelegateTask execution)  {
        // … …
    }


I  guess  this  problem  may  be  caused  by  the  transaction  control, please give me some advice.

Outcomes