IBM Business Process Manager, V8.0.1, All platforms > Reference > Commands and scripts > Commands (wsadmin scripting)
BPMDeleteSnapshot command
This command is run against a server instance to delete process application snapshots and their dependencies. For example, you may want to run the command if an excessive number of snapshots is causing your system to slow down.
Purpose
Use the BPMDeleteSnapshot command in connected mode from Process Server to delete snapshots and their dependencies for a specific process application. The BPMDeleteSnapshot command cannot be used from Process Center.
You can only run the command for one process application at a time.In a network deployment environment, you must run this command on the node containing the application cluster member that handles Process Server or Process Center applications. Do not run this command from the deployment manager profile.
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 cannot be the default snapshot
- The snapshot must be inactive
- The snapshot must have no running instances
- The snapshot must not be deployed
- 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 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 snapshot instances in the Inspector view of Process Designer.
Generally, you can prepare a snapshot for deletion by completing the following steps:
- Run the BPMShowProcessApplication command to determine whether the snapshot exists for the process application.
- Run the BPMShowSnapshot command to determine the status of the snapshot, such as whether it is the default snapshot and whether it is active with running instances.
- Run the BPMDeactivate command to deactivate the snapshot.
- Run the BPMStop command to stop the snapshot and its running instances.
- Run the BPMUndeploy command to undeploy the snapshot from the server. This also uninstalls any business-level applications that are related to the snapshot.
After you have completed these tasks, you can run the BPMDeleteSnapshot command.
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 occurs 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.
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:
- Make a second attempt to redeploy the snapshot to the other node without restarting the node. This second attempt at redeployment should be successful.
- Restart any other nodes where you want to redeploy the snapshot and then redeploy the snapshot to the nodes.
- Redeploy the snapshot to the same node where the BPMDeleteSnapshot admin task was run.
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 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 process application snapshots. For example, snapshot 01 and snapshot 02 might have acronyms of SS2.0.1 and SS2.0.2.
- -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:
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}}
Parent topic: Commands (wsadmin scripting)