Embedded Task Form: Show information about running process instances

Hi all

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.
But the things get too complex for me to handle all this stuff in JavaScript.

I did some research and came to the following options:

  1. 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.

  2. 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?

Thank you.

Kind regards

@miguelgalaxy here is a example of how you can use the REST API to pull the various info you would need using Javascript inside of a Embedded Task Form:

You just need to change the API endpoints for your needs.

What is your use case for doing this inside of a Task Form?
Based on the info you provided, it sounds like you would be better off creating a small app (or Tasklist/Cockpit plugin) that acted as a dashboard, and then allowed you to create a Process Instance or Task instance from that dashboard)

Hi @miguelgalaxy,

you can find some documentation how to extend the rest api here: https://docs.camunda.org/manual/7.6/reference/rest/overview/embeddability/

I tried this approach some times in the past and it worked well.

Hope this helps, Ingo

I used the REST API to display the required information to the user.

1 Like

Hi @miguelgalaxy!
can you please share some code snippets/links on how to about that?