Elena LucconeInnovation und Technologie

How to undeploy process applications from IBM Process Server

Sometimes you want to delete a whole application from a test environment with many snapshots, which you deployed during your tests. I searched for a simple example last days how to do this, but couldn’t find any, so I’m posting one.

I am not going to explain the usage and the options of every command that I use. If there is something unclear please refer to the official wsadmin documentation.

I am using IBM BPM 8.5.1. I have a Process Center installation in my development environment and a Process Server installation in my test environment.

In my test environment I have one application DEMO1 and 2 snapshots snp1 and snp2, I see both snapshots in the Process Admin Console (Snp1 is default and snp2 is “active”, because I choose to leave the running instances when I created the installation package.):

2014-03-process-undeploy-1

So, I would like to delete the whole application now!  I will first show some possible problems and explain how to avoid them:

The first problem you may hit is to find the name of the snapshots, that you want to delete.

You can delete snapshots in wsadmin (in my examples I use -lang jython): using AdminTask.BPMDeleteSnapshot.

We remember, my snapshots were named snp1 and snp2, but the Process Server doesn’t know these names. If I try to delete snapshot snp1 I will receive:

wsadmin>AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms SNP1]‘)

WASX7015E: Exception running command: „AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms SNP1]‘)“; exception information:

java.lang.Exception: java.lang.Exception: SnapshotDeleteSupport.deleteSnapshot by Acronym: The snapshot specified by containerAcronym=DEMO1 containerSnapshotAcronym=SNP1 does not exist.

To check the correct snapshot names I run AdminTask.BPMShowProcessApplication:

wsadmin>AdminTask.BPMShowProcessApplication(‚[-containerAcronym DEMO1]‘)

‚Name: DemoAppnAcronym: DEMO1nDescription: nToolkit: falsenTracks:nntList of Snapshots: nttName: snp1nttAcronym: S1nttCreated On: 2014-03-07 09:45:28.047nttCreated By: User.1nttIs Default: truenttState: State[Active]nttCapability: Capability[Standard]nttNo of running instances: 0nnttName: snp2nttAcronym: S2nttCreated On: 2014-03-07 09:45:37.855nttCreated By: User.1nttIs Default: falsenttState: State[Active]nttCapability: Capability[Standard]nttNo of running instances: 0nn‘

So snp1 is known as S1 and snp2 as S2. I should use S1 and S2 as input for containerSnapshotAcronym.

You can only delete inactive snapshots.

If I try to delete an active snapshot, I will receive:

wsadmin>AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms S2]‘)

WASX7015E: Exception running command: „AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms S2]‘)“; exception information:

java.lang.Exception: java.lang.Exception: You cannot delete an active snapshot. Please refer to the help information about BPMDeleteSnapshot in the Info Centre.

It is very important to delete all not default snapshots before you deactivate the default snapshot.

If there is one not default snapshot, you will not be able to deactivate the default snapshot.

You can deactivate snapshots in Process Admin.

So, let’s try to deactivate the default snp1 first to see what happens. In Process Admin I click on the snp1 (default and active) and then choose “Deactivate Application”. I receive an error:

2014-03-process-undeploy-2

You cannot delete the default snapshot before you delete the not default snapshots.

If I try to do this, I will receive:

wsadmin>AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms S1]‘)

WASX7015E: Exception running command: „AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms S1]‘)“; exception information:

java.lang.Exception: java.lang.Exception: You cannot delete a default snapshot. Please refer to the help information about BPMDeleteSnapshot in the Info Centre.

So, lessons learned, let’s do it in the right way!

In Process Admin I deactivate snp2:

2014-03-process-undeploy-3

In wsadmin I delete snp2:

wsadmin>AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms S2]‘)

‚BPMDeleteSnapshot passed.‘

In Process Admin I deactivate the default snapshot snp1:

2014-03-process-undeploy-4

In wsadmin, I delete the default snapshot snp1:

wsadmin>AdminTask.BPMDeleteSnapshot(‚[-containerAcronym DEMO1  -containerSnapshotAcronyms S1]‘)

‚BPMDeleteSnapshot passed.‘

That’s it!

Schlagwörter: ,