Hi all,
I am using camunda 7 (Rest API) and below is my use case:
User 2 or 3 can reject the approval process (/engine-rest/task/:id/complete by passing a process variable say ‘isApproved’) and workflow goes back to User 1. However I would like to pass the reason for rejection while calling the complete api. So that I can see the reason for rejection as part of org.camunda.bpm.engine.rest.dto.history.HistoricTaskInstanceDto or some thing similar.
Example data: Rejected due to missing data
Is there any way that I can pass the custom data and retrieve the data as part of history. Users can reject multiple times. (i.e., User can provide rejection reason for each user task)
you have to decide, in which structure the data should be kept. If you overwrite existing process variables with new values, the old values will be kept in the history, if you run with history level FULL. And you can retrieve them with this rest endpoint: Camunda Automation Platform 7.20.2 REST API
Or you can create variables, that are local to the tasks. But it’s more difficult to access the values later in the process instance.
Another option could be to add the comments to a generic list of comments.
I tried it by myself and only get valid responses, when I use the ID_ from the ACT_HI_DETAIL table.
If you look for the history of a variable, it is easier to use this request: Get Historic Details | docs.camunda.org with valid search criteria (a process instance id).
Thank you so much for this solution @Ingo_Richtsmeier
I am able to get the variables using localhost:8080/engine-rest/history/detail?processInstanceId=67a69376-ba1a-11ee-a333-9ae8c9bb4c60 and I can filter the variables using activityInstanceId for a specific user task.