1 Reply Latest reply on Dec 30, 2005 11:01 AM by brittm

    HowTo remove a ProcessInstance Q

    fmuhlenberg

      Running within jBoss, I have a process instance that has ended normally. When I search for current process instances, I find my terminated process being listed -- hasEnded() returns true.

      Now, I want to remove that instance from the DB tables but find that exceptions are generated when create a transaction -or- nothing happens when I don't use transactions.

      So, what is the accepted (prefered) method to remove a process instance?

        • 1. Re: HowTo remove a ProcessInstance Q
          brittm

           

          JbpmSessionFactory jbpmSessionFactory = JbpmSessionFactory.getInstance();
           JbpmSession jbpmSession = jbpmSessionFactory.openJbpmSession();
           GraphSession graphSession = jbpmSession.getGraphSession();
          
           jbpmSession.beginTransaction();
           graphSession.deleteProcessInstance(processInstanceId);
           jbpmSession.commitTransaction();
           jbpmSession.close();
          Simple enough; however, in certain scenarios there are still (I believe) one or two persistance issues that can creep up that may prevent the record deletion from ocurring successfully.

          -Britt