cancel
Showing results for 
Search instead for 
Did you mean: 

rest api query/historic-process-instances

liuyong
Champ in-the-making
Champ in-the-making
used api query/historic-process-instances, and body is
{
"processDefinitionId" : "myProcess:1:108",
  "variables" : [ ]
},
the Response is
{
  "data": [
    {
      "id": "109",
      "url": "http://localhost:8080/activiti-explorer/service/history/historic-process-instances/109",
      "businessKey": null,
      "processDefinitionId": "myProcess:1:108",
      "processDefinitionUrl": "http://localhost:8080/activiti-explorer/service/repository/process-definitions/myProcess%3A1%3A108",
      "startTime": "2014-01-23T10:02:18.993+0000",
      "endTime": "2014-01-23T10:03:00.003+0000",
      "durationInMillis": 41010,
      "startUserId": "test",
      "startActivityId": "startevent1",
      "endActivityId": "endevent1",
      "deleteReason": null,
      "superProcessInstanceId": null,
      "variables": []
    }
  ],
  "total": 1,
  "start": 0,
  "sort": "processInstanceId",
  "order": "asc",
  "size": 1
}
but the quest body is
{
  "id" : "109",
  "variables" : [
  ]
}
the Response  is
{
  "errorMessage": "Unsupported Media Type",
  "statusCode": 415
},
someone can tell me the reason
4 REPLIES 4

liuyong
Champ in-the-making
Champ in-the-making
can someone tell me, thanks!

frederikherema1
Star Contributor
Star Contributor
If you want to get a single historic process instance by ID, there is no need to query. Each instance represents a unique REST-resource. Just build up an URL using the ID:


GET history/historic-process-instances/{processInstanceId}

liuyong
Champ in-the-making
Champ in-the-making
thanks

ccavero
Champ in-the-making
Champ in-the-making
Hi i am newbie in Activiti, I am using 5.16.1 and when i call

GET history/historic-process-instances/{processInstanceId} the variables are empty and of course history/historic-process-instances/{processInstanceId}/variables does not work (neither {variableId} or {variableId}/data).

GET history/historic-process-instances?includeProcessVariables=true returns all the process instances with the variables included but i dont want to retrieve all the process instances stored.

The solution for me was to use the following REST api

GET history/historic-variable-instances?processInstanceId={processInstanceId}

But i consider that the first one should work, am I doing something wrong?

Thanks and regards.
Carlos.