This topic applies only to the IBM Business Process Manager Advanced configuration.

Business Process Choreographer maintenance and recovery scripts

There are several maintenance-related scripts for Business Process Choreographer. Run these maintenance scripts as part of a general maintenance policy to help maintain database performance, or as part of a recovery process as deemed necessary.

You should run these scripts to remove from the database the templates and their associated objects, as well as completed process instances, that are not contained in any corresponding valid application in the configuration repository.

There is also the possibility of having invalid process templates. This situation can occur if an application installation was canceled or not stored in the configuration repository by the user.

IBM® Business Process Manager also provides a service that automates Business Process Choreographer cleanup. You can run that service from the administrative console.

Use the following scripts for Business Process Choreographer recovery maintenance:
deleteInvalidProcessTemplate.py
Run this script to delete, from the Business Process Choreographer database, business process templates that are no longer valid. You cannot use this script to remove templates of valid applications from the database. This condition is checked and a ConfigurationError exception is thrown if the corresponding application is valid.
Note: These templates usually have no impact. They are not shown in Business Process Choreographer Explorer.
deleteInvalidTaskTemplate.py
Run this script to delete, from the Business Process Choreographer database, human task templates that are no longer valid. You cannot use this script to remove templates of valid applications from the database. This condition is checked and a ConfigurationError exception is thrown if the corresponding application is valid.
deleteCompletedProcessInstances.py
Run this script when all completed process instances have to be deleted. A top-level process instance is considered completed when it is in one of the following end states:
  • Finished
  • Terminated
  • End
  • Failed
You can specify the criteria to selectively delete top-level process instances and all their associated data (such as activity instances, child process instances, and inline task instances) from the database.
Note: When running these scripts from the command line, make sure that the SOAP client timeout is longer than the duration of the requested operation. For more information about this timeout, see "Connection timeout when running a wsadmin script".

Deleting an allotment of completed process instances

You can delete an allotment of process instances from the development environment.

Using a script that wrappers the provided deleteCompletedProcessInstances.py

  • By editing and placing correct user names, passwords, and paths in this wrapper script, you can delete an allotment of process instances from the development environment.
  • Carefully selecting an adequate time slice prevents SOAP timeout exceptions when communicating with the deployment manager.
  • The adequate time slice of administrable instances depends on many factors including, but not limited to, the following:
    • JVM tuning and memory allocations
    • Transaction log configuration for the database server
    • SOAP connection Time-Out configuration

Example

For example, after altering the script and running the command as:
wsadmin.<bat|sh> -user<USERNAME> -password<PASSWORD> -f loopDeleteProcessInstances.py
2008-04-02T21:00:00 3600
This command will run deleteCompletedProcessInstances.py while increasing the completed before time stamp by one hour (60 minutes * 60 seconds) after every execution.
The deleteCompletedProcessInstances.py script has a time stamp parameter which can be used to control the number of instances being deleted. The smaller the interval, the fewer instances will be deleted per invocation of the deleteCompletedProcessInstances.py. This can be useful in situations where deletion of multiple process instances encounter transaction timeouts. The most common cause for transaction timeouts during process deletion involve the following:
  • An untuned database
  • An overloaded system
  • An attempt to delete "too many" process instances at once