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.
Hey @Lakshan,
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
Cheers
Nele
In a summary, we can conclude as Java delegate expressions running instance details are not showing in the cockpit. but, I could not able to find a proper answers for the followings.
What is the mechanism to see running instances details in the cockpit
there could be instances where the java delegate expression takes time to complete. How is the load & instance status captured in such a situation?
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.
Is there any paid or non-paid mechanism for showing the running instances in the following scenarios?
Multiple java delegates running after another and they will get much time (around 5 -10 mins). numbers of instances are parallel running at the same time
External web APIs are called in some delegates. if getting more time to call that API, how do identify the total number of running instances at the time
The only mechanism that I am aware of is to make liberal use of the async flag on your activities.
I would strongly recommend against that, as it will decrease your throughput.
What are you hoping to get by showing a user this information from the web UI?
The main purpose here is to allow others (like the operation team) to monitor the progress of workflows. Are there possible ways for this when using java delegates?