Get data out of the H2 database

Hi Team,

I am making a process mining use case, which will keep an eye on the processes happening in Camunda for tracking any unexpected behaviour.

For this I need the Details like the Start Times and End Times etc. for Each process Instance that is running in Engine.

Now I have found this info in the table : **ACT_HI_PROCINST **

Now my only query is, I want this data to be available to the Java App External to Camunda system, ( but can be possibly hosted on the same Server, Tomcat )

I tried accessing the H2 database from within IntelliJ with the url jdbc:h2:tcp:///./camunda-h2-dbs/process-engine

But Failing continuously, for unknown reasons.
Also tried jdbc:h2:./camunda-h2-dbs/process-engine , It connects at leas, but Unable to further fetch ACT_HI_PROCINST this way.

Can you please help me on :-

  1. Either a proper dbc URL / Alternative technique to access ACT_HI_PROCINST.
  2. Or Tell me the Exact API’s with which I can extract out data from these tables.

Please help :slight_smile:

You can get this info via history rest api.
For example /rest/engine/default/history/process-instance
https://docs.camunda.org/manual/7.9/user-guide/spring-boot-integration/rest-api/

1 Like

Thank you so much @neplatnyudaj for the answer…
Solution worked exactly.
For others, https://docs.camunda.org/manual/latest/reference/rest/process-instance/ is the API you need to check.

Thanks again.

ashsharma28 how exactly did you do it because I am trying to do the same can you show me the code or github?