IBM BPM, V8.0.1, All platforms > Administer the IT infrastructure > Administer Business Process Choreographer > Use the administrative console to administer Business Process Choreographer

Configure the cleanup service and cleanup jobs

Use the administrative console to configure and schedule cleanup jobs that periodically delete instances of BPEL processes and human tasks that are in particular states.

Identify times of the day and days of the week, when it would be best to schedule the cleanup service, for example, when there is the lowest load on the database. For each BPEL process and human task that you want the cleanup service to delete, decide which states make an instance a candidate for deletion, and decide how long an instance must be in one of those states before the next scheduled cleanup deletes them.

You want completed instances to be deleted automatically after keeping them for a while. There is a separate cleanup service for the Business Flow Manager and for the Human Task Manager. For each of them, first enable the service and define the service parameters, such as the schedule, maximum duration of the cleanup, and the database transaction size. Then you can define cleanup jobs for sets of templates and define the end states and the duration that an instance must be in to qualify for deletion.

The Human Task Manager cleanup service only deletes stand-alone human tasks, but when the Business Flow Manager cleanup service deletes a BPEL process, it also deletes all of the child processes and inline human tasks that are contained in the process. When security is enabled, the cleanup user ID specified for the Business Process Choreographer configuration must be in the business administrator role.


Procedure

  1. Configure the cleanup service for the Business Flow Manager.


    1. To configure the cleanup service in a cluster, in the administrative console, click Servers > Clusters > WebSphere application server clusters > cluster_name, then on the Configuration tab, in the Business Integration section, expand Business Process Choreographer, and click Business Flow Manager.

    2. To configure the cleanup service on a stand-alone server, in the administrative console, click Servers > Server Types > WebSphere application servers > server_name, then on the Configuration tab, in the Business Integration section, expand Business Process Choreographer, and click Business Flow Manager.

    3. Choose one of the following options:

      • To change settings without having to restart the server, select the Runtime tab.

      • To make changes that will only have an effect after the server is restarted, select the Configuration tab.

    4. In the Additional properties section, click Cleanup Service Settings.

    5. If the cleanup service is not enabled, select Enable cleanup service. For a cluster configuration, the cleanup service will be scheduled to run on one of the cluster members of the cluster it is configured on.

    6. For Frequency, specify the time and frequency when the Business Flow Manager cleanup service will run. Enter a WebSphere crontab format string, which defines the start of a low load time slot.

      For example, to run the cleanup service every night at eleven o'clock, use the default value of 0 0 23 * * ? .

    7. For Maximum duration, enter the maximum time that the cleanup is allowed to run. The default is 120 minutes. Verify that the maximum duration is shorter than the time interval specified by the frequency.

    8. For Transaction slice, enter the number of BPEL process instances that will be deleted in each database transaction. The default value is 10. Because the value affects the performance of the cleanup service, it is worth trying different values. Depending on the size of the human tasks being deleted, you might be able to increase the slice size to increase the performance. However, if you get transaction timeouts, you should reduce the value.
    9. Save your changes.

  2. Add a new cleanup job for the Business Flow Manager.

    1. In the administrative console, on the Business Flow Manager page, click Cleanup Service Jobs.

    2. To create a new cleanup job, click Add.

    3. If this is not the only cleanup job, for Order Number, you can select a sequence number that determines the order that the jobs will be run, starting with number zero.

    4. For Cleanup Job, enter a name for the job.

    5. For Templates, either enter the name of one or more BPEL process templates (one per line) whose instances (including any inline human tasks) will be deleted, or enter an asterisk (' *') to specify all BPEL process templates.

    6. For Restrict cleanup to instances in the following states, select one or more of the following states:

      • FINISHED
      • TERMINATED
      • FAILED

    7. For Duration until deletion, specify how long an instance must be in one of the specified states before it becomes eligible for deletion by the cleanup job. Enter integers in the following fields: Minutes, Hours, Days, Months, and Years. The default is two hours.

    8. Click Apply or OK.
    9. Save your changes.

    10. If necessary, repeat this step to define more cleanup jobs for BPEL process instances.

  3. Configure the cleanup service for the Human Task Manager.


    1. To configure the cleanup service in a cluster, in the administrative console, click Servers > Clusters > WebSphere application server clusters > cluster_name, then on the Configuration tab, in the Business Integration section, expand Business Process Choreographer, and click Human Task Manager.

    2. To configure the cleanup service on a stand-alone server, in the administrative console, click Servers > Server Types > WebSphere application servers > server_name, then on the Configuration tab, in the Business Integration section, expand Business Process Choreographer, and click Human Task Manager.

    3. If the cleanup service is not enabled, select Enable cleanup service. For a cluster configuration, the cleanup service will be scheduled to run on one of the cluster members of the cluster it is configured on.

    4. For Frequency, specify the time and frequency when the Human Task Manager cleanup service will run. Enter a WebSphere crontab format string, which defines a low load time slot.

      If the cleanup service for the Business Flow Manager is also enabled, specify a schedule that does not overlap with the time window defined by the values specified in steps 1.f and 1.g.

      For example, if the Business Flow Manager cleanup service starts every night at one o'clock, and can run for up to two hours, you can specify that the cleanup service for the Human Task Manager runs every night at three o'clock by entering the value 0 0 3 * * ?.

    5. For Maximum duration, enter the maximum time that the cleanup is allowed to run. The default is 120 minutes. Verify that the maximum duration is shorter than the time interval specified by the frequency.

    6. For Transaction slice, enter the number of human task instances that will be deleted in each database transaction. The default value is 10. Because the value affects the performance of the cleanup service, it is worth trying different values. Depending on the size of the human tasks being deleted, you might be able to increase the slice size to increase the performance. However, if you get transaction timeouts, you should reduce the value.
    7. Save your changes.

  4. Add a new cleanup job for the Human Task Manager.

    1. In the administrative console, on the Human Task Manager page, click Cleanup jobs.

    2. To create a new cleanup job, click Add.

    3. If this is not the only cleanup job, for Order Number, you can select a sequence number that determines the order that the jobs will be run, starting with number zero.

    4. For Cleanup Job, enter a name for the job.

    5. For Templates, either enter the name of one or more stand-alone human task templates (one per line) whose instances will be deleted, or enter an asterisk ( *) to specify all stand-alone human task templates. To specify a namespace for a task template, append it in brackets, for example, myTaskTemplate (http://bpc/samples/task/).

      The Human Task Manager cleanup service can also delete inline invocation tasks that are started using the Human Task Manager API.

    6. For Restrict cleanup to instances in the following states, select one or more of the following states:

      • FINISHED
      • TERMINATED
      • FAILED
      • INACTIVE
      • EXPIRED

    7. For Duration until deletion, specify how long an instance must be in one of the specified states before it becomes eligible for deletion by the cleanup job. Enter integers in the following fields: Minutes, Hours, Days, Months, and Years. The default is two hours.

    8. Click Apply or OK.
    9. Save your changes.

    10. If necessary, repeat this step to define more cleanup jobs for stand-alone human task instances.

  5. If you made the changes on the Configuration tab, restart the server to activate the changes.


Results

You have activated the cleanup services and defined cleanup jobs to delete completed instances. When the cleanup service starts and finishes, the messages CWWBF0118I and CWWBF0119I are written to the SystemOut.log file. When one cleanup job starts and finishes, the messages CWWBF0116I and CWWBF0117I are written to the SystemOut.log file. Progress updates of the cleanup processing are written with message CWWBF0120I to the SystemOut.log.

Use the administrative console to administer Business Process Choreographer


Related concepts:
Cleanup procedures for Business Process Choreographer