AnsweredAssumed Answered

[HELP]How can I get task variable from historyService?

Question asked by doudou1990 on Mar 20, 2013
Latest reply on Mar 20, 2013 by jbarrez
development environment : jsf +javaDB

hello everybody~

i'm making a history diagram for the businessLogicticsprocess.
the process contains several tasks, when submit a task , a new entity create and set the id into taskvariable.
now i must get the taskvariable.

firstly

<bean id="processEngineConfiguration" class="org.activiti.cdi.CdiStandaloneProcessEngineConfiguration">
        <property name="history" value="full"/>
</bean>


List<HistoricTaskInstance> historicTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(processInstanceId).list();
        for (HistoricTaskInstance hti : historicTasks) {
            List<HistoricDetail> vars = historyService.createHistoricDetailQuery().processInstanceId(hti.getProcessInstanceId().taskId(hti.getId()).list();
            List<HistoricDetail> vars2 = historyService.createHistoricDetailQuery().processInstanceId(hti.getProcessInstanceId()).list();
        }

vars=null
vars2 can get the true variabls but the whole processVars not what i want.
i noticed that, the vars2 i've got ,getTaskId()=null;

so  what's the matter…?

Outcomes