A Cockpit plugin which shows a grid list of Failed Jobs on the start page of Cockpit and has three columns: Job ID
, Process instance ID
and Exception
.
This plugin is centered around the Failed Jobs concept and these are the other related concepts which could help us to understand it:
- Jobs are explicit representations of a task to trigger process execution. A job is created whenever a wait state is reached during process execution that has to be triggered internally. This is the case when a timer event or a task marked for asynchronous execution (see transaction boundaries) is approached.
- Job Definitions: When a process is deployed, the process engine creates a Job Definition for each activity in the process which will create jobs at runtime.
- The Job Executor has two responsibilities: job acquisition and job execution.
- Incidents: Examples of such incidents may be a failed job with elapsed retries (retries = 0), indicating that an execution is stuck and manual administrative action is necessary to repair the process instance.
- Failed Jobs: Unresolved incidents of a process instance or a sub process instance are indicated by Cockpit as failed jobs.
This plugin basically is a showcase of the capabilities of the Cockpit plugin engine which allows creation of dynamic views with a minimum amount of lines of code. The other point is to show how the Camunda REST API actually works and how handy it is to create a new Cockpit plugin using Camunda UI components which are built upon Angular directives.
Each Cockpit plugin has an Angular Controller, a unique pseudo-URL, such as: plugin://failed-jobs-plugin/static/app/failed-jobs-table.html
and some other attributes, which are used to register the plugin in a view by a JavaScript Object called ViewsProvider
and its registerDefaultView
function in the module configuration.
-
Build this demo:
mvn clean install
-
Clone the camunda-bpm-webapp repository
-
Add the plugin as a dependency to the camunda-bpm-webapp
pom.xml
and rebuild the Camunda web application.
<dependencies>
...
<dependency>
<groupId>org.camunda.bpm.cockpit.plugin</groupId>
<artifactId>cockpit-failed-jobs-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
Use under terms of the Apache License, Version 2.0