Cleanup procedures for Business Process Choreographer
An overview of the runtime objects that can be deleted from the database after they are no longer needed, and the tools available.
Types of tools available for deleting objects
Depending
on which types of objects you want to delete, you can use one or more
of the following tools:
- The cleanup service.
- The cleanup daemon for deleting shared work items and unused cached people query results.
- The administrative console.
- Administrative scripts to delete objects.
- The modeling tool.
- Failed Event Manager.
- Business Process Choreographer Explorer.
- Business Process Choreographer APIs.
Objects that can be deleted and tools to use
The following Business Process Choreographer database objects can be deleted when they are no longer needed.
- API-accessible objects
- You can write your own cleanup tool that uses the Business Process Choreographer APIs to delete process instances, task instances, and task templates that were created at run time using the APIs. Templates that are part of an enterprise application cannot be deleted using the APIs. For general information about using the APIs, refer to Programming BPEL processes and tasks.
- Process and task templates
- Templates can be deleted in the following ways:
- Run a script to delete templates:
- Process and task instances
- Instances can be deleted from the Business Process Choreographer
database in the following ways:
- Using the Process Admin Console or REST API calls, as described in Monitoring and maintaining system data.
- Using the administrative console to configure the cleanup service to schedule jobs that periodically delete eligible instances, which is described in Configuring the cleanup service and cleanup jobs.
- Run a script to delete completed instances:
- Set the appropriate properties in the business model, using Integration Designer:
- For business processes:
- The property Automatically delete the BPEL process after
completion can have the value
Yes
,No
, orOn successful completion
. If this property has the valueNo
orOn successful completion
, it makes sense to configure a cleanup job to delete the process instances. - For human tasks:
- The property Auto deletion mode can have the
value
On completion
, orOn successful completion
(which is the default). Deletion will only take place, and you can only change the value for Auto deletion mode, if the property Duration until task is deleted either has the value Immediate or a defined interval. If the property Duration until task is deleted has the value Never, automatic deletion is disabled, the Auto deletion mode property cannot be changed, and it makes sense to configure a cleanup job to delete the human tasks. Otherwise, if Duration until task is deleted does not have the value Never, and Auto deletion mode has the valueOn successful completion
, then it makes sense to define a cleanup job to delete the human tasks that do not complete successfully.
- To delete a few instances, it can be convenient to use the Business Process Choreographer Explorer, which you can use to check details about the instances before you delete them.
Note: You can use more than one of these techniques for deleting instances. In which case, an instance is deleted by the first attempt to delete it. - Audit log entries
- You can delete audit log entries by running the deleteAuditLog.py script, which is described in Deleting audit log entries, using administrative scripts.
- Hold queue
- Messages that cannot be processed are placed on the hold queue,
this includes messages for instances that were deleted. You can empty
the hold queue by replaying the messages in the queue, which causes
any messages for deleted instances to be discarded.
- Querying and replaying failed messages, using the administrative console describes how to replay messages using the Business Process Choreographer pages, and using the failed event manager page.
- Querying and replaying failed messages, using administrative scripts
- Shared work items
You can delete unused shared work items by running the cleanupUnusedStaffQueryInstances.py script with the -cleanupSharedWorkItems option, which is described in Removing unused people query results, using administrative scripts.
By default, the cleanup daemon for deleting shared work items and unused cached people query results regularly deletes unused shared work items. You can change the schedule on the Human Task Manager configuration and runtime pages in the administrative console. You can also modify the cleanup daemon's behavior using the administrative console to set the following Human Task Manager custom properties:Human Task Manager custom property Description SharedWorkItemCleanup.Interval
This property uses the WebSphere crontab
format to control the schedule. The default value of0 0 3 * * ?
causes the daemon to run every night at three o'clock. To disable the daemon, set the value to the valueDURATION_INFINITE
. This schedule applies to both the cleanup of shared work items and the cleanup of unused cached people query results.SharedWorkItemCleanup.Timeout
Specifies the maximum number of seconds that the shared work item cleanup can take. If this custom property is not set, the default that is used is 3600
seconds (one hour).- People queries
- You can delete unused people queries by running the cleanupUnusedStaffQueryInstances.py
script, which is described in Removing unused people query results, using administrative scripts. By default, unused cached people query results are deleted by the cleanup daemon for deleting shared work items and unused cached people query results. The schedule is shared with the shared work item cleanup, which you can change on the Human Task Manager configuration and runtime pages in the administrative console or by changing the Human Task Manager custom property
SharedWorkItemCleanup.Interval
. You can also use the administrative console to change the timeout and slice size by setting the following Human Task Manager custom properties:Human Task Manager custom property Description UnusedStaffCleanup.Timeout
Specifies the maximum number of seconds that the people query cleanup can take. If this custom property is not set, the default used is 3600
seconds (one hour).UnusedStaffCleanup.SliceSize
The number of unused people query results that are deleted in each transaction. If this custom property is not set, the default value of 500
is used.Note: If the performance of deleting the unused people queries is too slow, you can optionally improve the performance by adding a new database index on the tableSTAFF_QUERY_INSTANCE_T
for the columnIS_SHAREABLE
.