AnsweredAssumed Answered

no deployed process definition found with id 'LeaveProcess'

Question asked by tangyanjun001 on Sep 1, 2011
Latest reply on Sep 1, 2011 by tangyanjun001
Hi everybody,

   I am looking 10 minutes training and I have deployed the process, but something wrong here . as below:
  
            public static void main(String[] args) {
      ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            "activiti.cfg.xml");
//      String deployId = deploy(context);
//      System.out.println("deploy id : "+deployId);
      
      RuntimeService runtimeService = (RuntimeService) context.getBean("runtimeService");
      runtimeService.startProcessInstanceById("LeaveProcess");      
   }

   public static String deploy(ClassPathXmlApplicationContext applicationContext) {
      RepositoryService repositoryService = (RepositoryService) applicationContext.getBean("repositoryService");
      String deploymentId = repositoryService.createDeployment().addClasspathResource("main/resources/diagrams/LeaveProcess.bpmn20.xml").deploy().getId();
      return deploymentId;
   }


        When I run this main method . runtimeService.startProcessInstanceById("LeaveProcess") throw a Exception . Infomation as below:


org.activiti.engine.ActivitiException: no deployed process definition found with id 'LeaveProcess'   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedProcessDefinitionById(DeploymentCache.java:50)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:51)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:30)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:57)
   at com.activiti.test.ActivitiTest.main(ActivitiTest.java:19)
Exception in thread "main" org.activiti.engine.ActivitiException: no deployed process definition found with id 'LeaveProcess'
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedProcessDefinitionById(DeploymentCache.java:50)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:51)
   at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:30)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:57)
   at com.activiti.test.ActivitiTest.main(ActivitiTest.java:19)

Outcomes