Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 30. Managing log data
Red Hat Process Automation Manager manages the required maintenance runtime data. It removes some data automatically, including the following data types:
- Process instance data, which is removed upon process instance completion.
- Work item data, which is removed upon work item completion.
- Task instance data, which is removed upon completion of a process to which the given task belongs.
Runtime data that is not cleaned automatically includes session information data that is based on the selected runtime strategy.
- Singleton strategy ensures that runtime data of session information is not automatically removed.
- Per request strategy allows automatic removal when a request is terminated.
- Per process instances automatically removes process instance data when a process instance is mapped to a session that is completed or aborted.
Red Hat Process Automation Manager also provides audit log data tables. You can use these tables to keep track of current and past process instances. By default, Red Hat Process Automation Manager does not remove any data from audit log tables.
There are three ways to manage and maintain the audit data tables:
- You can set up an automatic cleanup of these tables using Business Central, as described in Section 30.1, “Setting up automatic cleanup job”.
- You can remove information from the tables manually using the Java API, as described in Section 30.2, “Manual cleanup”.
- You can run a custom query on the Red Hat Process Automation Manager database, including the audit log tables, as described in Section 30.4, “Running a custom query on the Red Hat Process Automation Manager database”.
30.1. Setting up automatic cleanup job
You can set up an automatic cleanup job in Business Central.
Procedure
- In Business Central, go to Manage > Jobs.
- Click New Job.
- Enter values for Business Key, Due On, and Retries fields.
Enter the following command into the Type field.
org.jbpm.executor.commands.LogCleanupCommand
To configure parameters, complete the following steps:
- Click the Advanced tab.
- Click Add Parameter.
- In the Key column, enter a parameter.
- In the Value column, enter a parameter.
For the list of parameters for the command, see Section 30.3, “Removing logs from the database”.
- Click Create.
Business Central creates the automatic cleanup job.
30.2. Manual cleanup
To perform manual cleanup, you can use the audit Java API. The audit API consists of the following areas:
Name | Description |
---|---|
Process audit |
It is used to clean up process, node and variable logs that are accessible in the
For example, you can access the module as follows: |
Task audit |
It is used to clean up tasks and events that are accessible in the
For example, you can access the module as follows: |
Executor jobs |
It is used to clean up executor jobs and errors that are accessible in the
For example, you can access the module as follows: |
30.3. Removing logs from the database
Use LogCleanupCommand
executor command to clean up the data, which is using the database space. The LogCleanupCommand
consists of logic to automatically clean up all or selected data.
There are several configuration options that you can use with the LogCleanupCommand
:
Name | Description | Is Exclusive |
---|---|---|
|
Indicates whether process and node instances, and process variables log cleanup is skipped when the command runs. The default value is | No, it is used with other parameters. |
|
Indicates if the task audit and event log cleanup are skipped. The default value is | No, it is used with other parameters. |
|
Indicates if Red Hat Process Automation Manager executor entries cleanup is skipped. The default value is | No, it is used with other parameters. |
|
Indicates if a job routine runs only once. The default value is | No, it is used with other parameters. |
|
Schedules the next job execution. The default value is
For example, set to | No, it is used with other parameters. |
|
Logs that are older than the specified date are removed. The date format is |
Yes, it is not used with |
|
Logs that are older than the specified timer expression are removed. For example, set |
Yes, it is not used with |
| Specifies process definition ID for logs that are removed. | No, it is used with other parameters. |
|
Indicates the number of records in a transaction that is removed. The default value is | No, it is used with other parameters. |
| Specifies deployment ID of the logs that are removed. | No, it is used with other parameters. |
| Persistence unit name that is used to perform delete operation. | Not applicable |
LogCleanupCommand
does not remove any active instances, such as running process instances, task instances, or executor jobs.
30.4. Running a custom query on the Red Hat Process Automation Manager database
You can use the ExecuteSQLQueryCommand
executor command to run a custom query on the Red Hat Process Automation Manager database, including the audit log data tables. You can set up a job that runs this command in Business Central.
Procedure
- In Business Central, select Manage > Jobs.
- Click New Job.
- Enter values for Business Key, Due On, and Retries fields.
Enter the following command into the Type field.
org.jbpm.executor.commands.ExecuteSQLQueryCommand
To configure parameters, complete the following steps:
- Open the Advanced tab.
- Click Add Parameter.
- In the Key column, enter a parameter value.
- In the Value column, enter a parameter value.
For the list of parameters for the command, see Section 30.4.1, “Parameters for the
ExecuteSQLQueryCommand
command”.- Click Create. Business Central creates the custom query job.
Optional: If you want to retrieve the results of the query, complete the following steps:
- In the list of jobs that Business Central displays, find the job that you started. If the job is not present in the list, remove any filters from the Active filters list.
- Record the id value for the job.
-
Using a web browser, access the Swagger documentation on your KIE Server at
<kie_server_address>/docs
, for example,http://localhost:8080/kie-server/docs/
. -
Click the
GET /server/jobs/{jobId}
request. - In the jobId field, enter the id value that you recorded.
-
From the withErrors list, select
true
. -
From the withData list, select
true
. - Click Execute.
-
Review the Server response field. If the SQL query succeeded, the result is under the
"response-data"
key.
30.4.1. Parameters for the ExecuteSQLQueryCommand
command
The ExecuteSQLQueryCommand
executor command runs a custom query on the Red Hat Process Automation Manager database, including the audit log tables. For the schema for the audit log tables, see Process engine in Red Hat Process Automation Manager.
You can configure the following parameters for the ExecuteSQLQueryCommand
command.
Name | Description |
---|---|
|
|
| name of the persistence unit to be used to run the query |
| The business key to use with the query. If configuring the command in Business Central, use the business key that you set for the job |
|
The native SQL query to execute. Preface parameters with the |
|
List of all parameters in the SQL query. Separate the parameters with the |
SQL parameter name | The value for the SQL parameter. Create a separate command parameter for every SQL parameter |
For example, you might use a query with two parameters:
SELECT * FROM RequestInfo WHERE id = :paramId AND businessKey = :paramKey
Set the following parameters for the ExecuteSQLQueryCommand
command:
-
SQL
:SELECT * FROM RequestInfo WHERE id = :paramId AND businessKey = :paramKey
; -
parametersList
:paramId,paramKey
-
paramId
: The value forid
-
paramKey
: The value forbusinessKey