cancel
Showing results for 
Search instead for 
Did you mean: 

HistoricVariableInstanceQuery - taskId method

lixkid
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to get all HistoricVariableInstances for particular taskId by using taskId(String taskId) method from HistoricVariableInstanceQuery class, but instead of getting just those HistoricVariableInstances whose id is equal to taskId parameter of taskId method, this method returns HistoricVariableInstances for every process variable that exists in ACT_HI_VARINST table.

Is this expected behaviour of HistoricVariableInstanceQuery.taskId method (it certainly is not based on short description in documentation), or am I possibly doing something wrong in the way the method is called, or the way process variables are represented in ACT_HI_VARINST table?
4 REPLIES 4

trademak
Star Contributor
Star Contributor
In the FullHistoryTest testHistoricVariableInstanceQueryTaskVariables method we test this behavior, and it's working fine there. Maybe you can include the code you are executing?

Best regards,

lixkid
Champ in-the-making
Champ in-the-making
This code is executed in an application which uses Activiti Engine 5.11:
<code>

@Inject
private ProcessEngine processEngine;

HistoryService historyService = processEngine.getHistoryService();
HistoricVariableInstanceQueryImpl hviq = (HistoricVariableInstanceQueryImpl) historyService.createHistoricVariableInstanceQuery();
List<HistoricVariableInstance> hviLst = hviq.taskId(taskId).list();

</code>

taskId represents particular taskId and hviLst contains all HistoricVariableInstances from ACT_HI_VARINST table.

trademak
Star Contributor
Star Contributor
Okay that looks like valid code. Can you create a unit test that shows the error you are facing?

Thanks,

lixkid
Champ in-the-making
Champ in-the-making
I've created an issue http://jira.codehaus.org/browse/ACT-1717 for this problem.