3 Replies Latest reply on Aug 23, 2005 6:36 AM by alkero

    Delete Process Definition or Instance

    tom.baeyens

      i think i fixed that today. try the next release.

      regards, tom.

        • 1. Re: Delete Process Definition or Instance
          calvin1

          I have had the same problem and found that a manual delete from the JBPM_LOG:

          delete from JBPM_LOG
          Where exists
          (select JBPM_VARIABLEINSTANCE.id_
          from JBPM_VARIABLEINSTANCE
          where JBPM_LOG.variableinstance_ = JBPM_VARIABLEINSTANCE.id_
          and JBPM_VARIABLEINSTANCE.processinstance_ = yourProcessInstanceId)

          ...followed by the variable instance rows that are causing the conflict:
          delete from JBPM_VARIABLEINSTANCE
          Where JBPM_VARIABLEINSTANCE.processinstance_ = yourProcessInstanceId

          ...allows the deleteProcessInstance() to complete and perform a successful commit to the database.
          Hopefully this will patch it until the next release.


          This can be done using:
          String [] sql = new String[4];
          sql[0] = "begin transaction";
          sql[1] = "delete from JBPM_LOG Where exists (select id_ from JBPM_VARIABLEINSTANCE where JBPM_LOG.variableinstance_ = JBPM_VARIABLEINSTANCE.id_ and JBPM_VARIABLEINSTANCE.processinstance_ = " + processInstance.getId() + ")";
          sql[2] = "delete from JBPM_VARIABLEINSTANCE Where JBPM_VARIABLEINSTANCE.processinstance_ = " + processInstance.getId();
          sql[3] = "commit";
          //
          jbpmSessionFactory.getJbpmSchema().execute(sql);

          Once the process instance or definition is deleted i have not found any side effects from the manual delete

          • 2. Re: Delete Process Definition or Instance
            fallow

            Tom,

            Thanks for looking into this. What release will this be a part of? I checked sourceforge and do not see any releases for a 3.1 beta or such.

            Eric

            • 3. Re: Delete Process Definition or Instance

              Hello Tom,

              It seems it doesn't work for me.
              I have added a "delete" action in the cvs webapp (from the process instances list for a process definition), and an exception occurs with this action.

              May be you can test the webapp delete action ?

              Thanks.

              Regards,
              David