2 Replies Latest reply on Nov 17, 2005 5:05 PM by gwittwer

    error removing process definition using jbpm 3.0.1 and oracl

    dsteinbrunn

      Hi,

      When I try to delete a process definintion, I'm getting the constraint violation error


      ERROR - ORA-02292: integrity constraint (Z002065.FK_PROCDEF_STRTSTA) violated - child record found


      The child it is complaining about is the start state foreign key that points to a node:


      alter table JBPM_PROCESSDEFINITION add constraint FK_PROCDEF_STRTSTA foreign key (STARTSTATE_) references JBPM_NODE;


      Looking at the hbm files, it appears that process definition has a many to one relationship to node regarding start state:


      <many-to-one name="startState"
      column="STARTSTATE_"
      foreign-key="FK_PROCDEF_STRTSTA" />




      I'm using jbpm 3.0.1 and Oracle 9. I googled around a bit, and I see this problem also existed for deleting a process instance ( http://jira.jboss.com/jira/browse/JBPM-312), and it was fixed for 3.0.1. I don't know if the same fix works for process definition, or if it is an unrelated problem. Has anyone else run into this problem, and if so, how did you fix it?


      The code I'm using to delete is as follows:


      public void deleteProcessDefinition(ProcessDefinition processDef){
      this.logDebug("deleting process definition " + processDef.getName());

      JbpmSession jbpmSession = sessionFactory.openJbpmSession();
      GraphSession graphSession = jbpmSession.getGraphSession();
      jbpmSession.beginTransaction();
      graphSession.deleteProcessDefinition(processDef);
      jbpmSession.commitTransaction();
      jbpmSession.getSession().flush();
      jbpmSession.close();

      }



      Thanks in advance[/url]