BPMSnapshotCleanup command

Use the BPMSnapshotCleanup command to delete all the unnamed and archived snapshots of a process application on a Process Center server.

Purpose

Note: In an environment with multiple security domains configured, use the PALService MBean instead of this wsadmin command. See Scripting tools for managing process applications.
Important: Before you use this command, you must install interim fixes. See the Issues with BPMDeleteSnapshot and BPMSnapshotCleanup commands in IBM Business Process Manager (BPM) flash technote.
From a Process Center server, use the BPMSnapshotCleanup command to delete unused snapshots of a process application when they are obsolete or older than a specified snapshot.
Restriction:
  • You must be a repository administrator.
  • You cannot delete the first snapshot of a process application even though it might be unnamed or archived. The first snapshot contains original information about the snapshot that is displayed in the history panel in Process Designer.
  • You must archive named snapshots before you delete them.
  • Before running the BPMSnapshotCleanup command, go to the Process Designer Inspector and remove all BPD instances that are related to the unnamed or archived snapshot that you want to delete.
  • To avoid conflicts between operations and snapshots on the Process Center, you must run the BPMSnapshotCleanup command at specified intervals. Run the command when there are no operations on the Process Center and no connections between the Process Designer and the Process Center.

Parameters

You can delete unnamed snapshots and archived snapshots by using the same BPMSnapshotCleanup command with different parameters. You can also delete snapshots in batches for better performance.
Note: You must set at least one of the optional parameters such as containerSnapshotAcronyms, keptNumber, createdBeforeLocal, createdAfterLocal, or createdBeforeSnapshotAcronym as the filter for the BPMSnapshotCleanup command.
containerAcronym
A required parameter that identifies the process application that contains the snapshots to be deleted. For example, the BillingDispute process application might have an acronym of BILLDISP.
Tip: If you do not know the acronym for a parameter, use the BPMShowProcessApplication command to list the details of a process application, including acronyms.
containerTrackAcronym
An optional parameter that identifies the acronym of the track that contains the snapshots to be deleted. If this parameter is not specified, the default track is used.
containerSnapshotAcronyms
An optional parameter that identifies the acronyms for the set of archived snapshots to be deleted. Use this parameter to delete a specific set of archived snapshots. If this parameter is specified, you cannot specify other filters, such as values for the keptNumber, createdBeforeLocal, createdAfterLocal, createdBeforeSnapshotAcronym, or deleteArchivedSnapshot parameters.
keptNumber
An optional parameter that uses an integer to identify the number of unnamed snapshots to keep when a snapshot cleanup is run. The most recent snapshots are kept. The tip snapshot is not counted in keptNumber.
  • If keptNumber is greater than or equal to the total number of unnamed snapshots, no snapshots are deleted.
  • If keptNumber equals 0, all the unnamed snapshots are deleted except the tip snapshot.
The keptNumber parameter cannot be specified with the createdBeforeLocal or createdAfterLocal parameters.
createdBeforeLocal
An optional parameter that specifies a local time value in string format for filtering unnamed snapshots by the date they were created. Unnamed snapshots are deleted if they were created before the specified time. When createdBeforeLocal is used with the createdAfterLocal parameter, createdBeforeLocal deletes the set of snapshots that were created within the specified time period. The specified value can have a yyyy-MM-ddThh:mm:ss (year, month, day, T, hours, minutes, seconds) or yyyy-MM-dd string format.
createdAfterLocal
An optional parameter that specifies a local time value in string format for filtering unnamed snapshots by the date they were created. Unnamed snapshots that are created after the specified time are deleted. When createdAfterLocal is used with the createdBeforeLocal parameter, createdAfterLocal deletes the set of snapshots that were created within the specified time period. The specified value can have a yyyy-MM-ddThh:mm:ss (year, month, day, T, hours, minutes, seconds) or yyyy-MM-dd string format.
createdBeforeSnapshotAcronym
An optional parameter that specifies the acronym of a named snapshot. Unnamed snapshots are deleted if they were created before the specified snapshot. When createdBeforeSnapshotAcronym is used with the keptNumber parameter, the number of snapshots that are specified is retained. When createdBeforeSnapshotAcronym is used with the createdBeforeLocal or createdAfterLocal parameters, createdBeforeSnapshotAcronym deletes the unnamed snapshots that were created between the time when the named snapshot was created and the time that is specified by the createdBeforeLocal or createdAfterLocal parameter.
deleteArchivedSnapshot
An optional parameter of the Boolean type that specifies whether the archived named snapshot is deleted with the snapshots that are identified by the filter parameters. If you set the value of deleteArchivedSnapshot to true, both archived and unnamed snapshots are deleted in one command. By default, deleteArchivedSnapshot is set to false.
When deleteArchivedSnapshot is set to true and is used with other filter parameters, such as keptNumber, createdBeforeLocal, createdAfterLocal, and createdBeforeSnapshotAcronym, both archived snapshots that match the conditions that are specified by the other filter parameters and the unnamed snapshots are deleted.
ignoreDependency false
An optional parameter of the Boolean type that specifies whether to delete snapshots that other project applications depend on. This parameter is set to false. Do not change the default value.
outputFile
An optional parameter that specifies a qualified file path to write the snapshot cleanup log entries. The default log file is systemout.log.

Examples

The following examples illustrate how to delete snapshots that use the BPMSnapshotCleanup command.

Delete unnamed snapshots that are based on the keptNumber parameter
Jython example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython

AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -containerTrackAcronym Main -keptNumber 100]')
Jacl example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin 

$AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -containerTrackAcronym Main -keptNumber 100}
Delete unnamed snapshots that are based on a time span that fall within a particular time range
Jython example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdAfterLocal 2012-01-01T00:00:00 
-createdBeforeLocal 2012-02-31T21:37:06]')
Jacl example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin 

$AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -createdAfterLocal 2012-01-01T00:00:00 
-createdBeforeLocal 2012-02-31T21:37:06}
Delete unnamed snapshots that are based on the createdBeforeLocal parameter
Jython example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdBeforeLocal 2012-01-02T21:37:06]') 

Or:
AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdBeforeLocal 2012-05-02 
-deleteArchivedSnapshot true]')
Jacl example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin 

$AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -createdBeforeLocal 2012-01-02T21:37:06} 

OR: $AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -createdBeforeLocal 2012-05-02 
-deleteArchivedSnapshot true}
Delete unnamed snapshots that are based on the createdAfterLocal parameter
Jython example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdAfterLocal 2012-05-31T21:38:00]') 

OR: AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdAfterLocal 2012-07-31 
-deleteArchivedSnapshot true]')
Jacl example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin 

$AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -createdAfterLocal 2012-05-31T21:38:00} 

OR: $AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -createdAfterLocal 2012-07-31 
-deleteArchivedSnapshot true}
Delete unnamed snapshots that are based on the createdBeforeSnapshotAcronym parameter
Jython example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -createdBeforeSnapshotAcronym SS2.0.1]')
Jacl example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin 

$AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -createdBeforeSnapshotAcronym SS2.0.1}
Delete a specified archived snapshot
Jython example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin -lang jython 

AdminTask.BPMSnapshotCleanup ('[-containerAcronym BILLDISP -containerTrackAcronym Main 
-containerSnapshotAcronyms SS2.0.1]')
Jacl example
wsadmin -conntype SOAP -port 4080 -host PC1.mycompany.com -user admin -password admin 

$AdminTask BPMSnapshotCleanup {-containerAcronym BILLDISP -containerTrackAcronym Main 
-containerSnapshotAcronyms SS2.0.1}