BPMDeleteSnapshot command

This command is run against a server instance to delete snapshots for process applications or toolkits. For example, you may want to run the command if an excessive number of snapshots is causing your system to slow down.

Purpose

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.

Use the BPMDeleteSnapshot command in connected mode from Process Server to delete snapshots for process applications or toolkits. The BPMDeleteSnapshot command cannot be run on Process Center.

You can only run the command for one process application or toolkit at a time. In a network deployment environment, you must run this command on the node containing the application cluster member that handles process applications on Process Server or Process Center. In a default network deployment configuration, the node is one of the AppTarget cluster members. Do not run this command from the deployment manager profile.

Note: Only a user with Repository Admin privileges can delete a snapshot.
The following preconditions must exist for any snapshot that you want to delete:
  • The snapshot must exist.
  • The snapshot must be inactive and not deployed.
  • The snapshot must have no running process instances.
  • The snapshot cannot reference task instances that are shared with other snapshots.
  • The snapshot cannot be referenced by a stand-alone task.
  • On BPM Advanced, any business-level applications that are related to the snapshot must be uninstalled before you can delete the snapshot.

If one or more of the preconditions has not been met when the command is run, the command is terminated and an error message is written to the command-line console and the server’s SystemOut.log file to indicate which of the preconditions was not met. Generally, the message contains some suggestions for achieving the preconditions. For example:

You cannot delete an active snapshot.

To view the status of a snapshot, use the BPMShowSnapshot command. You can also view the status of task and process instances for a snapshot in the Inspector view of Process Designer or in the Inspector view of the Process Admin Console.

Generally, you can prepare a snapshot for deletion by completing the following steps:

After you have completed these tasks, you can run the BPMDeleteSnapshot command.

Note: When you delete a snapshot, any related BPD instances that have a status of Terminated, Completed, or Failed will also be deleted.
If you are using a SOAP connection, this command can take longer to complete than the default SOAP timeout value, which will result in an exception. This exception might occur in the following circumstances:
  • When you are using the command to remove a snapshot with many running business process instances. If you plan to remove snapshots with many business process instances, increase the value of the SOAP.requestTimeout property, which is set by default to 180 seconds. You can find this property in the soap.client.props file in the following path: <your server profile>/properties.
  • When you are deleting many snapshots at a time using the command: $AdminTask BPMDeleteSnapshot {-containerAcronym PA01 -containerSnapshotAcronyms {Snapshot01 Snapshot02 ...}} Note that in this case Process Server snapshot deletion is not affected.

If you delete a snapshot on a node that is running IBM Process Server in an ND environment and you make an initial attempt to redeploy the snapshot to another node without first restarting the node, the redeployment may fail and the following message (or a variation of it) may be logged in the log files:

E   CWLLG2229E: An exception occurred in an EJB call.  Error: Could not get branch from VersioningContext

To resolve the problem, you can choose any one of the following actions:

Parameters

If you do not know the acronym for a required parameter, use the BPMShowProcessApplication command to list the details of a process application and its snapshots, including acronyms.

-containerAcronym containerAcronym
A required parameter of type String that identifies the acronym of the process application or toolkit that contains the snapshots. For example, the BillingDispute process application might have an acronym of BILLDISP.
-containerSnapshotAcronyms containerSnapshotAcronyms
A required parameter of type String[] that identifies the acronyms of the snapshots. For example, snapshot 01 and snapshot 02 might have acronyms of SS2.0.1 and SS2.0.2.
-force
A parameter that specifies that you want to delete the default snapshot of a process application. Default snapshots are not deleted unless you include the force parameter.
-outputFile outputFile
This is an optional parameter that provides a qualified file path to write the snapshot cleanup log entries. The default log file is systemout.log.

Example

The following examples shows how to establish a SOAP connection to Process Server and delete those snapshots for the process application BILLDISP that have snapshots acronyms of SS2.0.1 and SS2.0.2:

Important: In a network deployment environment, use the port configured for the application cluster member that runs the Process Server or Process Center applications. To determine the correct port number, see the WebSphere administrative console Ports collection page (click Servers > Server Types > WebSphere application servers > server_name > Communications > Ports and find the value for SOAP_CONNECTOR_ADDRESS).
  • Jython example
    wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython
    
    AdminTask.BPMDeleteSnapshot('[-containerAcronym BILLDISP -containerSnapshotAcronyms [SS2.0.1 SS2.0.2]]')
  • Jacl example
    wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin
    
    $AdminTask BPMDeleteSnapshot {-containerAcronym BILLDISP -containerSnapshotAcronyms {SS2.0.1 SS2.0.2}}