cancel
Showing results for 
Search instead for 
Did you mean: 

Historic Process Variable Not Being Returned

bcymet
Champ in-the-making
Champ in-the-making
Hi,

I am using activiti 5.15.1 with a postgresql db.

When I use the rest api to query historic process variables and I am getting all process variables but one back:

https://blqadb3.ls.cbn/restactiviti/service/history/historic-variable-instances?processInstanceId=70...


{"data":[{"id":"718","processInstanceId":"701","processInstanceUrl":"https://blqadb3.ls.cbn/restactiviti/service/history/historic-process-instances/701','taskId':null,'v...":[[{\"numberOfDraws\":1,\"gamename\":\"La Diaria\",\"purchaseStructureName\":\"Regular\",\"wagerAmount\":5,\"quickPick\":true,\"playData\":\"\"},{\"numberOfDraws\":1,\"gamename\":\"La Diaria\",\"purchaseStructureName\":\"Regular\",\"wagerAmount\":5,\"quickPick\":true,\"playData\":\"\"},{\"numberOfDraws\":1,\"gamename\":\"La Diaria\",\"purchaseStructureName\":\"Regular\",\"wagerAmount\":5,\"quickPick\":true,\"playData\":\"\"},{\"numberOfDraws\":1,\"gamename\":\"La Diaria\",\"purchaseStructureName\":\"Regular\",\"wagerAmount\":5,\"quickPick\":true,\"playData\":\"\"},{\"numberOfDraws\":1,\"gamename\":\"La Diaria\",\"purchaseStructureName\":\"Regular\",\"wagerAmount\":5,\"quickPick\":true,\"playData\":\"\"}]]}}","scope":null}},{"id":"728","processInstanceId":"701","processInstanceUrl":"https://blqadb3.ls.cbn/restactiviti/service/history/historic-process-instances/701','taskId':null,'v...}


Even thought that variable is in the databae


SELECT * from act_hi_varinst where name_ = 'serialNumber' and proc_inst_id_ = '701';
id_ | proc_inst_id_ | execution_id_ | task_id_ |    name_     | var_type_ | rev_ | bytearray_id_ | double_ | long_ | text_ | text2_ |      create_time_       |   last_updated_time_   
—–+—————+—————+———-+————–+———–+——+—————+———+——-+——-+——–+————————-+————————-
727 | 701           | 701           |          | serialNumber | string    |    0 |               |         |       | A     |        | 2014-06-20 15:18:07.206 | 2014-06-20 15:18:07.221


I thought it might be that I had set to many process variables so I tired not setting one I still got the same result.

Any ideas why the variable would be in the DB but not returned in the rest query?

Thanks,

Bram
3 REPLIES 3

bcymet
Champ in-the-making
Champ in-the-making
The even weirder part is if I ask for the variable by name I do get the value I am looking for:

https://blqadb3.ls.cbn/restactiviti/service/history/historic-variable-instances?variableName=serialN...
<code>
{"data":[{"id":"727","processInstanceId":"701","processInstanceUrl":"https://blqadb3.ls.cbn/restactiviti/service/history/historic-process-instances/701','taskId':null,'v...}}],"total":1,"start":0,"sort":"variableName","order":"asc","size":1}
</code>

In the end this is what I really need but I am still confused as to why this variable isn't returned in the complete list.

jbarrez
Star Contributor
Star Contributor
This confuses me too … there is no filtering being done in the query!

You could always enhance the log level on the engine side, and see which SQL query is being executed for that call.

marcuss
Champ in-the-making
Champ in-the-making
I was having the same problem and found this topic. However, I was trying to get binary data and I found the solution in the Alfresco documentation: http://docs.alfresco.com/activiti/topics/getTheBinaryDataForAHistoricProcessInstanceVariable.html

Solution: GET history/historic-process-instances/{processInstanceId}/variables/{variableName}/data