I would like to show information about running process instances and process variables (of these process instances) in an embedded task form. And it should be possible to refresh this information as the information might have changed in the meantime.
One possibility is to use the REST API (RuntimeService, HistoryService etc.) and display this information to the user.
I did some research and came to the following options:
Collect the information in Java (in a JavaDelegate bound to the activity) and put the information to be shown on the UI in a Java Object and this Java Object in a process variable, so that it is accessible from Java Script. I wonder, how I can trigger a refresh of this Java Object from the embedded task form.
Contribute a REST API endpoint which delivers the information needed. Here I could refresh the information on the UI easily by triggering another XMLHttpRequest. But I could not find an easy to follow manual how to extend the REST API.
Which approach would you recommend? Or do you recommend another approach?