Historic Query on task variable returns empty result

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2011 11:58 AM
I am trying to query for some historic tasks with the following query:
List<HistoricTaskInstance> tasks = actHistoryService.createHistoricTaskInstanceQuery()
.processInstanceId(processId).taskVariableValueEquals("taskType", "specify")
.orderByHistoricTaskInstanceEndTime().desc().list();
I enabled sql logging to see the generated sql query and it searches for the task variable in the table ACT_HI_DETAIL:
==> Executing: select * from ACT_HI_TASKINST HTI WHERE HTI.PROC_INST_ID_ = ?
and exists ( select HD.ID_ from ACT_HI_DETAIL HD where HD.TYPE_ = 'VariableUpdat
e' and HD.NAME_ = ? and HD.TASK_ID_ = HTI.ID_ and HD.REV_ = (select max(HDM.REV_
) from ACT_HI_DETAIL HDM where HDM.TASK_ID_ = HTI.ID_ and HDM.VAR_TYPE_ = ? and
HDM.NAME_ = ? and HDM.TYPE_ = 'VariableUpdate') and HD.TIME_ = (select max(HDM.T
IME_) from ACT_HI_DETAIL HDM where HDM.TASK_ID_ = HTI.ID_ and HDM.VAR_TYPE_ = ?
and HDM.NAME_ = ? and HDM.TYPE_ = 'VariableUpdate') and HD.VAR_TYPE_ = ? and HD.
TEXT_ = ? ) order by END_TIME_ desc
However this table is completely empty, so no row is returned.
Is there something special to enable writing historic task variables to the table ACT_HI_DETAIL?
If this is the case: Are there performance problems to be expected with writing historic task variables or why is this not enabled by default?
Best regards,
Maarten Donders
List<HistoricTaskInstance> tasks = actHistoryService.createHistoricTaskInstanceQuery()
.processInstanceId(processId).taskVariableValueEquals("taskType", "specify")
.orderByHistoricTaskInstanceEndTime().desc().list();
I enabled sql logging to see the generated sql query and it searches for the task variable in the table ACT_HI_DETAIL:
==> Executing: select * from ACT_HI_TASKINST HTI WHERE HTI.PROC_INST_ID_ = ?
and exists ( select HD.ID_ from ACT_HI_DETAIL HD where HD.TYPE_ = 'VariableUpdat
e' and HD.NAME_ = ? and HD.TASK_ID_ = HTI.ID_ and HD.REV_ = (select max(HDM.REV_
) from ACT_HI_DETAIL HDM where HDM.TASK_ID_ = HTI.ID_ and HDM.VAR_TYPE_ = ? and
HDM.NAME_ = ? and HDM.TYPE_ = 'VariableUpdate') and HD.TIME_ = (select max(HDM.T
IME_) from ACT_HI_DETAIL HDM where HDM.TASK_ID_ = HTI.ID_ and HDM.VAR_TYPE_ = ?
and HDM.NAME_ = ? and HDM.TYPE_ = 'VariableUpdate') and HD.VAR_TYPE_ = ? and HD.
TEXT_ = ? ) order by END_TIME_ desc
However this table is completely empty, so no row is returned.
Is there something special to enable writing historic task variables to the table ACT_HI_DETAIL?
If this is the case: Are there performance problems to be expected with writing historic task variables or why is this not enabled by default?
Best regards,
Maarten Donders
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2011 05:47 PM
Maarten,
Have a look at the different history levels in the docs. You need 'full' for this afaik…
Have a look at the different history levels in the docs. You need 'full' for this afaik…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2011 03:55 AM
Hi Ronald,
thanks a lot. Exactly what I needed.
groetjes,
Maarten
thanks a lot. Exactly what I needed.
groetjes,
Maarten
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2012 09:26 AM
I am trying to query for some historic tasks with the following query:
List<HistoricTaskInstance> tasks = actHistoryService.createHistoricTaskInstanceQuery()
.processInstanceId(processId).taskVariableValueEquals("taskType", "specify")
.orderByHistoricTaskInstanceEndTime().desc().list();
I enabled sql logging to see the generated sql query and it searches for the task variable in the table ACT_HI_DETAIL:
==> Executing: select * from ACT_HI_TASKINST HTI WHERE HTI.PROC_INST_ID_ = ?
and exists ( select HD.ID_ from ACT_HI_DETAIL HD where HD.TYPE_ = 'VariableUpdat
e' and HD.NAME_ = ? and HD.TASK_ID_ = HTI.ID_ and HD.REV_ = (select max(HDM.REV_
) from ACT_HI_DETAIL HDM where HDM.TASK_ID_ = HTI.ID_ and HDM.VAR_TYPE_ = ? and
HDM.NAME_ = ? and HDM.TYPE_ = 'VariableUpdate') and HD.TIME_ = (select max(HDM.T
IME_) from ACT_HI_DETAIL HDM where HDM.TASK_ID_ = HTI.ID_ and HDM.VAR_TYPE_ = ?
and HDM.NAME_ = ? and HDM.TYPE_ = 'VariableUpdate') and HD.VAR_TYPE_ = ? and HD.
TEXT_ = ? ) order by END_TIME_ desc
However this table is completely empty, so no row is returned.
Is there something special to enable writing historic task variables to the table ACT_HI_DETAIL?
If this is the case: Are there performance problems to be expected with writing historic task variables or why is this not enabled by default?
Best regards,
Maarten Donders
How to enabl sql logging to see the generated sql query in Activity?Which file to config?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2012 10:05 AM
That is default java.util.Logging. Just add a logging.properties on your classpath. Check the activiti source to find such a file for inspiration.
