I’m running the Camunda engine in my Spring boot microservice and created a sample BPMN file using service tasks with Java delegate expressions.
When I start camunda engine, I was able to see my process in process definition( Cockpit). But when I invoke my rest service which is running in a separate boot microservice, I could not able to see the instance running. Thanks in advance for the help.
I used camunda 7.15.0 and Java 11. is it possible to see the instance running service task with java delegate.
If you have a process with just Service Tasks and all are implemented as Java Delegates you won’t see an active instance in Cockpit because it will already be passed through. So there is basically no active instance and just history.
If you like to observe the state you could add a user task. Once the instance arrives there it will be visible in Cockpit.
There is also a possibility to use a History Plugin built by @datakurre. If you add it to Camunda you will be able to see the History of your process instances that passed through all the service tasks. You can also find a blog post about the plugin and the usage and installation.
I hope that solves your problem and makes the instance visible for you in Cockpit.
you don’t see the waiting state because everything in your process happens in one transaction. No matter if you add a “sleep” to your code. If you want to see the state of your process you need to include a symbol where a transaction happens. In general if you work with Camunda it is a good idea to get familiar with transaction boundaries.
I hope this helps
As Nele indicated before, you will only see running instances in cockpit when they cross a DB transaction point. They will show you the LAST time they crossed a DB transaction point, so if you have multiple Java Delegates running one after another and they all have async before, it won’t show you the absolute most current state, but the last time it was committed to DB.
The delegate running status is kept in memory.
The runtime engine keeps track of the state until it hits a DB transaction (eg. a User Activity or async definition) the instance will then be written to DB. When the process is next continued, the status will then be kept in memory again until it again hits a DB transaction point.