IBM Business Process Manager, V8.0.1, All platforms > Reference > Commands and scripts > Commands (wsadmin scripting)
BPMProcessInstancesCleanup command
Use this command to delete business process definition (BPD) instance data for a process application snapshot on IBM Process Server.
Purpose
Use this command deletes the BPD instance and its associated tasks for the instances that are specified by the command parameters. It also logs data to a standard systemout.log file to track which process applications were selected for deleting instance data.
To run this command, you must be in the tw_admins group. Also, you can run this command only in the connected mode. In a network deployment environment, you must run this command on the node containing the application cluster member that handles Process Server applications. Do not run this command from the deployment manager profile.
Restriction: The following restrictions apply:
- You cannot use this command to delete BPEL process instances.
- You can run the command from any cluster member in a network deployment environment. However, first establish the wsadmin session to the SOAP port of the cluster member from where you are running the command.
Parameters
- -containerAcronym containerAcronym
- A required parameter that identifies the acronym that specifies the process application to perform process instance cleanup against.
For example, the BillingDispute process application might have an acronym of BILLDISP.
- -containerSnapshotAcronym containerSnapshotAcronym
- A required parameter that identifies the snapshot acronym for the process application. The snapshot acronym can be different from the snapshot name. To find the snapshot acronym, run the BPMShowProcessApplication command. Refer to the topic in the related link.
- -instanceStatus instanceStatus
- A required parameter that identifies the status of process instances to clean up.
- COMPLETED - Removes all completed process instances
- FAILED - Removes all failed process instances
- CANCELED - Removes all terminated process instances
- ALL - Removes all completed, failed, and canceled process instances
You cannot delete an instance that is currently running.
- -instanceID instanceID
- An optional parameter of type String[] that identifies the number of instance IDs that are being removed. If there is more than one instance ID, each instance ID must be delimited by a space for Jython format commands or a semicolon for JACL format commands.
You can also use this parameter with endedAfterLocal or endedBeforeLocal. See the examples in this topic.
- -endedAfterLocal endedAfterLocal
- An optional parameter of type String that identifies the local time on the server. The string must have the following format:yyyy-MM-ddThh:mm:ss (year, month, day, T, hours, minutes, seconds). Only instances that completed, failed, or canceled after the specified time period by this parameter are processed. If you use this parameter with the endedBeforeLocal parameter, only instances that completed, failed, or canceled during the specified time period by this parameter are processed.
- -endedBeforeLocal endedBeforeLocal
- An optional parameter of type String that identifies the local time on the server. The string must have the following format: yyyy-MM-ddThh:mm:ss (year, month, day, T, hours, minutes, seconds). Only instances that completed, failed, or canceled after the specified time period are processed. If you use this parameter with the endedAfterLocal parameter, only instances that completed, failed, or canceled during the specified time period by this parameter are processed.
- -outputFileoutputFile
- An optional parameter that provides a qualified file path to write the process instance cleanup log entries. The default is systemout.log.
Examples
The following examples show how to use the BPMProcessInstancesCleanup command.
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).
- Deleting the BPD instance and its associated tasks for the instances
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym PA435 -containerSnapshotAcronym V1 -instanceStatus FAILED -outputFile C:\US58626\log1.txt]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym PA435 -containerSnapshotAcronym V1 -instanceStatus FAILED -outputFile C:\US58626\log1.txt}
- Deleting instances based that are based on instance IDs
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -instanceID [4 5 1001 1002]]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus FAILED -instanceID 1;2;1000;1003}- Deleting instances that occur during a time range that falls within a specific range
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-01-01T00:00:00 -endedBeforeLocal 2012-02-31T21:37:06]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-01-01T00:00:00 -endedBeforeLocal 2012-02-31T21:37:06}- Deleting instances that occur before the specified local time on the server
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedBeforeLocal 2012-01-02T21:37:06]') AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedBeforeLocal 2012-05-02]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedBeforeLocal 2012-01-02T21:37:06} $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedBeforeLocal 2012-05-02}- Deleting instances that occur after the specified local time on the server
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-05-31T21:38:00]') AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-07-31]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-05-31T21:38:00} $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-07-31}- Deleting specific instances that occur on a specific time range and are based on instance IDs
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-01-01T00:00:00 -endedBeforeLocal 2012-02-31T21:37:06 -instanceID [53 54 55]]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-01-01T00:00:00 -endedBeforeLocal 2012-02-31T21:37:06 -instanceID 53;54;55}- Deleting instances that occur before and after the specified local time on the server and are based on instance IDs
Jython example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin -lang jython AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-05-20T00:00:00 -instanceID [53 54 55 56 57 58]]') AdminTask.BPMProcessInstancesCleanup ('[-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedBeforeLocal 2012-05-31T21:37:06 -instanceID [53 54 55 56 57 58]]') Jacl example wsadmin -conntype SOAP -port 8880 -host ProcessServer01.mycompany.com -user admin -password admin $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedAfterLocal 2012-05-20T00:00:00 -instanceID 53;54;55;56} $AdminTask BPMProcessInstancesCleanup {-containerAcronym BILLDISP -containerSnapshotAcronym SS2.0.1 -instanceStatus ALL -endedBeforeLocal 2012-05-31T21:37:06 -instanceID 53;54;55;56}
Parent topic: Commands (wsadmin scripting)
Related information:
BPMShowProcessApplication command