cancel
Showing results for 
Search instead for 
Did you mean: 

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

doudou1990
Champ in-the-making
Champ in-the-making
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…?
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
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;

I'm sorry, but I really don't understand what you're trying to say/do. Could you elaborate?