General

[jBPM7 QuickTips] Native Jobs

In jBPM there are out-of-the-box jobs that can be used to keep the activated, for example, to maintain a status of the environment health. Let’s check some of them.

The available job commands source code is available at: https://github.com/kiegroup/jbpm/tree/master/jbpm-services/jbpm-executor/src/main/java/org/jbpm/executor/commands

ExecutionErrorCleanupCommand : process execution errors are stored into database tables. This Job takes care of these tables cleaning them according to the configuration provided by the user. When activated without further customization, it will be triggered once a day. 

LogCleanupCommand: jBPM uses a series of audit tables in order to keep historical process data. For example, once a process is completed, it’s data will be stored in an audit database table. When an environment is running for a long time or the audit tables are starting to get too big, it is important to set up a job to maintain the audit environmental health. 

This job will take care of processes audit logs, tasks audit logs, and the job executor related data. By default, it runs once a day starting at the moment when it was scheduled. 

SLATrackingCommand: in jBPM, it is possible to set an expected period to finish a process execution. It is called, SLA. SLATrackingCommand is a job that can identify all processes which have SLA violation and send them a signal. When the user wants to take further actions based on process SLA violation, it is possible to use this job along with a signal event which captures the “slaViolation” signal and take further actions.

Configuration

Here follow some possible ways to customize the default jobs that comes along with jBPM. Details can be obtained in each respective class code implementation.

ExecutionErrorCleanupCommand

Possible configuration:

SingleRunShould be set to true, if should be executed once
NextRunDefinition of the next execution time. Accepts  ISO-8601 date time format (yyyy-MM-dd’T’HH:mm:ss)
OlderThanDelete errors older than a given date.Accepts ISO-8601 date time format.
OlderThanPeriodDelete errors older than a given period. Accepts ISO-8601 period format, i.e. 10d, 1h. 
ForProcessDelete only errors related to a given process definition;
ForProcessInstanceDelete only errors related to a given process instance;
ForDeploymentDelete only errors related to a given deployment id;

LogCleanupCommand:  

Possible configuration:

SkipProcessLogShould process logs clean up should be skipped? Valid values: true or false
SkipTaskLogShould task logs clean up should be skipped? Valid values: true or false
SkipExecutorLogShould job executor logs clean up should be skipped? Valid values: true or false
SingleRunShould be set to true, if should be executed once
NextRunDefinition of the next execution time. Accepts ISO-8601 date time format (yyyy-MM-dd’T’HH:mm:ss)
OlderThanDelete errors older than a given date. Accepts ISO-8601 date time format.
OlderThanPeriodDelete errors older than a given period. AcceptsISO-8601 period format, i.e. 10d, 1h. 
ForProcessDelete only logs related to a given process definition;
ForDeploymentDelete only logs related to a given deployment id;

SLATrackingCommand

Possible configuration:

SingleRunShould be set to true, if should be executed once
NextRunDefinition of the next execution time. Accepts ISO-8601 date time format (yyyy-MM-dd’T’HH:mm:ss)
ForDeploymentTriggers a signal only for SLA violations related to a given deployment id;

2 thoughts on “[jBPM7 QuickTips] Native Jobs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s