Hi Clemens,
Have you set the history level to ‘Full’ or something to other than ‘None’? Have you provided at least one query parameter in the REST api call?
Hi @ClemensTan - The full audit is spread across variable “hi” tables and “hi resp api” . if you are interested to know the process instance history you can try to join ACT_HI_ACTINST and ACT_HI_OP_LOG . These 2 tables provide most of the Process history like task claim / unclaim / process suspend / boundary timers etc . Once this is working as expected you can write a native query of use ibatis and expose it as Custom Rest Api .
Hi Dinesh,
thank you for the explanation. I am very new to Camunda. I am using it as a black box (running as docker container) and try to access all data just over the provided REST API. I was wondering, if I can get all insights of a running or finished process over the existing REST API. So, to a complete event stream, I need to read the data directly from the history database?
Hi Joe, I think I miss understood the meaning of the /history/detail endpoint. I was looking for an end point, which gives me a full chronological list, of everything happend during a process. I would like to fetch the full “event stream” over the REST API.
Hi Dinesh,
thanks for the hint. So it seems, that I have to combine the results different REST calls to re-construct a full event stream. I guess, I should get familiar with the Java API or access the database directly.
in our use case, we need to collect as much runtime information as possible to be able to create reports automatically . We need any information we can collect (which path in the process has been chosen, which variables have been written to, what messages and events occurred).
We need a chronological combined log of “everything” to fulfill regulatory documentation requirements.
Hi @ClemensTan – Please see if the below query helps you .
// create a query against the ACT_HI_ACTHISTORY table and ACT_HI_OP_LOG table but TRANSFORM IT AS A “** TASK HISTORY(ACT_HI_TASKINST) INSTANCE **”
StringBuilder sb = new StringBuilder();
sb.append("SELECT ID_,TASK_ID_ AS TASK_DEF_KEY_, COALESCE(ASSIGNEE_,'SYSTEM') AS ASSIGNEE_ , START_TIME_, ACT_NAME_ AS NAME_ , ACT_TYPE_ AS ACT_INST_ID_,'' AS OWNER_ , '' AS DESCRIPTION_ , ");
sb.append("(SELECT START_USER_ID_ FROM ACT_HI_PROCINST WHERE PROC_INST_ID_=#{processInstanceId} ) AS TENANT_ID_ ");
sb.append(" FROM ACT_HI_ACTINST WHERE PROC_INST_ID_=#{processInstanceId} ");
sb.append(" UNION ALL");
sb.append(" SELECT ID_,TASK_ID_ AS TASK_DEF_KEY_, USER_ID_ AS ASSIGNEE_ ,TIMESTAMP_ AS START_TIME_, OPERATION_TYPE_ AS NAME_ , ENTITY_TYPE_ AS ACT_INST_ID_,ORG_VALUE_ AS OWNER_ ,NEW_VALUE_ AS DESCRIPTION_ , '' AS TENANT_ID_\r\n" +
"");
sb.append(" FROM ACT_HI_OP_LOG WHERE PROC_INST_ID_=#{processInstanceId}");
sb.append(" ORDER BY START_TIME_ ASC ");
List<HistoricTaskInstance> nativeActInstList = historyService.createNativeHistoricTaskInstanceQuery().
sql(sb.toString()).parameter("processInstanceId", processInstanceId).list();