Search code examples
spring-bootcamundabpmnbusiness-process-managementcamunda-modeler

find failed tasks and failed processes in camunda


For what reasons can find a task or a process for a specific user in Camunda fail with java API? This failure may be due to any reason. It just means failure. No suitable methods for this purpose were found in the history service, and if exist, which methods are they? Any idea how to get these values?


Solution

  • If a service task fails it usually creates an exception, which will be caught by the process engine, which will then create a "incident". Process instances having incident can be queried for and also be seen in Cockpit. The process execution will stop until the incident is resolved. However, there are few rare exceptions, which will also mark the transaction for rollback. In theses cases the process engine, running in the same transaction, has no chance to write something (an incident) to the database. The job execution will halt, but no incident will be visible. It is best to notice such cases via log monitoring and fix them right away. You could detect them later by querying for process instances, which are in the same state for longer periods of time / which do not have an active job.

    User tasks usually do not produce exceptions other than intentionally thrown BPMNErrors, which are used to tell the process engine that a business error (incident = technical error) happened and should be handled via BPMN2 error events on process model level. A user task can also set a data to indicate that an error situation exists, but complete regularly. The subsequent process can then work with the data value, e.g. using a gateway or conditional event.

    Free training covering such these aspects is available via: https://academy.camunda.com/c7-platform-java and https://academy.camunda.com/page/bpmn