Get Full Process History?

860 views
Skip to first unread message

Melissa Palmer

unread,
May 22, 2015, 7:19:57 AM5/22/15
to camunda-...@googlegroups.com
Hi 

Using the Camunda API is there a way to get the full history for a whole process if you only have the current taskId and/or processInstanceId? 

Thanks
Melissa

Gareth

unread,
May 22, 2015, 10:42:25 AM5/22/15
to camunda-...@googlegroups.com
Hi Melissa,

You should be able to use the current processInstanceID, to get the ProcessInstance object, ( see: http://docs.camunda.org/7.2/api-references/rest/#process-instance-get-single-instance ) which will contain the ProcessDefinitionId.  Once you have the ProcessDefinitionId you can use this as a parameter to query for the history of the 'whole process' ( see: http://docs.camunda.org/7.2/api-references/rest/#history-get-process-instances-post )

Kind Regards

Gareth

hassan....@gmail.com

unread,
May 25, 2015, 1:43:28 AM5/25/15
to camunda-...@googlegroups.com
Hi Melissa,

Using rest APIs
http://docs.camunda.org/7.2/api-references/rest/#history-get-task-historic

as you can see, you can query using processInstanceId as a parameter

Using java APIs
http://docs.camunda.org/7.2/api-references/javadoc/

HistoricTaskInstanceQuery processInstanceId(String processInstanceId)
Only select historic task instances for the given process instance.

Regards..
Hassan Ghanem

Melissa Palmer

unread,
May 26, 2015, 3:06:28 AM5/26/15
to camunda-...@googlegroups.com
Hi Gareth, and Hassan

Thanks for the feedback, however this isn't quite getting me what is needed. Most specifically when a process has a CallActivity to a sub-process. 
Using the API's (REST of Java) you only get the history for that processId and not the history for the sub-processes that we called from it (or before it... in the case where you are currently sitting within a sub-process node) 

Is there a way that one can use a processId (for a main or sub-process) which will get the history related to each other? 

Thanks
Melissa

hassan....@gmail.com

unread,
May 26, 2015, 3:26:04 AM5/26/15
to camunda-...@googlegroups.com
Hi Melissa,

If I understand you well. I think you can define a unique identifier as a process variable with the same name (for example: 'requestId') on both processes (main & sub). passing the value of it when calling a sub-process.

That way you can query by process variable name "the unique identifier"

http://docs.camunda.org/7.2/api-references/rest/#history-get-task-historic

Regards..
Hassan Ghanem
Reply all
Reply to author
Forward
0 new messages