Showing posts with label bpd. Show all posts
Showing posts with label bpd. Show all posts

Monday, August 18, 2014

Bulk Delete BPD Instances in IBM BPM 7.5

Problem Statement
How do I delete a large number of instances for a given BPD in IBM BPM 7.5.

Solution
  1. Start by finding the BPD Reference Number of the BPD (whose instances you want to purge). This can be located at "BPD_REF" column of "LSW_BPD_INSTANCE" table.
  2. Use the PL SQL block provided below to purge the BPD Instances. Supply the BPD Reference at the appropriate position.

DECLARE
  BPDINSTANCEID NUMBER;
  CURSOR instancesToDelete (bpdRef IN NUMBER) IS
    SELECT BPD_INSTANCE_ID
    FROM LSW_BPD_INSTANCE
    WHERE BPD_REF = bpdRef;
BEGIN
  BPDINSTANCEID := NULL;
  OPEN instancesToDelete(<BPD REFERENCE NUMBER>); 

  LOOP

    FETCH instancesToDelete  INTO BPDINSTANCEID;

    EXIT WHEN instancesToDelete%NOTFOUND;

    LSW_BPD_INSTANCE_DELETE(
      BPDINSTANCEID => BPDINSTANCEID
    );

  END LOOP;

END;