org.jbpm.executor.commands

## Class LogCleanupCommand

- java.lang.Object
- - org.jbpm.executor.commands.LogCleanupCommand

- All Implemented Interfaces:
    org.kie.api.executor.Command, org.kie.api.executor.Reoccurring
  Direct Known Subclasses:
    CaseLogCleanupCommand

      public class LogCleanupCommand
      extends Object
      implements org.kie.api.executor.Command, org.kie.api.executor.Reoccurring

  Log clean up command that aims at doing house keeping of audit/log tables used in jBPM:
  - process related audit logs (process instance, node instance, variables)
  - task related audit logs (audit task, task events)
  - executor related data (requests and errors)
  Command by default is auto configured to run once a day from the time it was initially scheduled though it can be reconfigured in terms of frequency when it is executed and if it shall run multiple times at all.
  Following is a complete list of accepted parameters:
  - SkipProcessLog - indicates if clean up of process logs should be omitted (true|false)
  - SkipTaskLog - indicates if clean up of task logs should be omitted (true|false)
  - SkipExecutorLog - indicates if clean up of executor logs should be omitted (true|false)
  - DateFormat - date format for further date related params - if not given yyyy-MM-dd is used (pattern of SimpleDateFormat class)
  - EmfName - name of entity manager factory to be used for queries (valid persistence unit name)
  - SingleRun - indicates if execution should be single run only (true|false)
  - NextRun - provides next execution time (valid time expression e.g. 1d, 5h, etc)
  - OlderThan - indicates what logs should be deleted - older than given date
  - OlderThanPeriod - indicated what logs should be deleted older than given time expression (valid time expression e.g. 1d, 5h, etc)
  - ForProcess - indicates logs to be deleted only for given process definition
  - ForDeployment - indicates logs to be deleted that are from given deployment id
  - RecordsPerTransaction - indicates number of records to be included in each DB transaction (default is 0 which means do the delete in one single transaction)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SimpleDateFormat` | `dateFormat`
    `static String` | `RECORDS_PER_TRANSACTION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogCleanupCommand()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.kie.api.executor.ExecutionResults` | `execute(org.kie.api.executor.CommandContext ctx)`
    `Date` | `getScheduleTime()`
    `protected int` | `readInt(Map<String,Object> params, String propName, int defaultValue)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### dateFormat

          protected final SimpleDateFormat dateFormat

    - #### RECORDS_PER_TRANSACTION

          public static final String RECORDS_PER_TRANSACTION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LogCleanupCommand

          public LogCleanupCommand()

  - ### Method Detail

    - #### getScheduleTime

          public Date getScheduleTime()

      Specified by:
        `getScheduleTime` in interface `org.kie.api.executor.Reoccurring`

    - #### readInt

          protected int readInt(Map<String,Object> params,
                                String propName,
                                int defaultValue)

    - #### execute

          public org.kie.api.executor.ExecutionResults execute(org.kie.api.executor.CommandContext ctx)
                                                        throws Exception

      Specified by:
        `execute` in interface `org.kie.api.executor.Command`
      Throws:
        `Exception`

Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.