2 Replies Latest reply on Mar 18, 2010 6:17 AM by uaibys

    Problem while executing a process under eclipse

      Hi,

       

      I want to execute a jbpm process using eclipse, and I tried this code :

       

      import org.jbpm.api.ProcessInstance;
      import org.jbpm.api.Configuration;
      import org.jbpm.api.ExecutionService;
      import org.jbpm.api.ProcessEngine;
      import org.jbpm.api.RepositoryService;

       


      public class Main {
         
          public static void main(String[] args){
          ProcessEngine processengine = new Configuration().buildProcessEngine();
         
          RepositoryService repositoryservice = processengine.getRepositoryService();
         
          ExecutionService executionservice = processengine.getExecutionService();
         
          String deploymentId = repositoryservice.createDeployment().addResourceFromClasspath("test/process.jpdl.xml").deploy();
         
          ProcessInstance processInstance = executionservice.startProcessInstanceById(deploymentId);
         
          }
      }

       

      But when I launch the execution, I have this error message :

       

      ### EXCEPTION ###########################################
      09:30:22,778 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd@118cb3a
      org.jbpm.api.JbpmException: no process definition with id '1'
          at org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:56)
          at org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)
          at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
          at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
          at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
          at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceById(ExecutionServiceImpl.java:50)
          at test.Main.main(Main.java:25)

       

      I think that it's caused by a configuration problem, but I don't know what is it. Could someone help me?

      Thanks !

        • 1. Re: Problem while executing a process under eclipse

          There is nothing wrong with your program and it is not the configuration problem.

           

          Problem is that, you have to specify the name of the ID from .jpdl file in startProcessInstanceById(ID) but not the deploymentId.

           

          I think this will solve your problem

          1 of 1 people found this helpful
          • 2. Re: Problem while executing a process under eclipse

            Thank you Anand Kumar,

             

            I resolved my problem. And to do that I changed the Id as you said, and also I changed the configuration file of hibernate in the target folder.

            Before, I had only copied the same configuration file of hibernate from the target folder of examples, but I am using MySQL DB not HSQL one, so I must configer jbpm to use that DB.