1 Reply Latest reply on Apr 25, 2007 2:13 PM by Cristi Macoviciuc

    How to use the Deployed Process Defination

    prabhu rdm Newbie

      Hi Folks,

      I have some issue on using the deployed process definition. Check out the following code

      try
      {
      GraphSession graphSession = jbpmContext.getGraphSession();

      ProcessDefinition processDefinations = graphSession.findLatestProcessDefinition("ApprovalProcess");

      if(processDefinations == null)
      jbpmContext.deployProcessDefinition(processDefinition);

      processDefinition = graphSession.findLatestProcessDefinition("ApprovalProcess");

      ProcessInstance processInstance = new ProcessInstance(processDefinition);


      Token token = processInstance.getRootToken();
      token.signal();
      }
      finally{ jbpmContext.close(); }

      Here I check whether process definition is already deployed or not? If not I deploy it orelse I take the existing process definition

      But when I run this code I get the following constraint error

      10:59:53,546 INFO [STDOUT] Hibernate: insert into JBPM_PROCESSINSTANCE (VERSION_, KEY_, START_, END
      _, ISSUSPENDED_, PROCESSDEFINITION_, ROOTTOKEN_, SUPERPROCESSTOKEN_, ID_) values (?, ?, ?, ?, ?, ?,
      ?, ?, ?)
      10:59:53,687 WARN [JDBCExceptionReporter] SQL Error: 1, SQLState: 23000
      10:59:53,687 ERROR [JDBCExceptionReporter] ORA-00001: unique constraint (FINDEVNEWCOA.SYS_C0061240)
      violated

      10:59:53,687 WARN [JDBCExceptionReporter] SQL Error: 1, SQLState: 23000
      10:59:53,687 ERROR [JDBCExceptionReporter] ORA-00001: unique constraint (FINDEVNEWCOA.SYS_C0061240)
      violated

      I think this is because of the process defination column in the process instance table is defined as unique key.

      If I deploy the process defination everytime to create a process instance, then it works fine.

      whether we need to deploy the process definition every time to create a process Instance?

      how to use the existing process defination to create a process instance?

      Folks, need suggestion from you.

      Thanks in advance,

      Prabhu.