AnsweredAssumed Answered

Cannot find process key

Question asked by frank41 on Apr 25, 2012
Latest reply on Apr 25, 2012 by frank41
Hi all !
I'm stuck with my first attempt to start a process instance. I have created via the Eclipse Plugin a bpmn process which is named "example"

<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="example" name="example">
   …..
</process>
I have packed this process in a Web application and deployed it into an application server (JBoss application server)
along with the following activiti.cfg.xml (into activiti.cfg.jar)
 <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">

    <property name="databaseSchemaUpdate" value="true" />
    <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti" />
    <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
    <property name="jdbcUsername" value="activiti" />
    <property name="jdbcPassword" value="activiti" />

    <property name="jobExecutorActivate" value="true" />

  </bean>
Next, I try to start a process instance from a Servlet with the following code:
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
      
Deployment deployment = repositoryService.createDeployment()
                        .name("mydeploy")
         .addClasspathResource("processes/demoProcess.bpmn.xml")
              .deploy();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("example");
I get the following error:
org.activiti.engine.ActivitiException: no processes deployed with key 'example'   org.activiti.engine.impl.persistence.deploy.DeploymentCache.findDeployedLatestProcessDefinitionByKey(DeploymentCache.java:63)
   org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:58)
   org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31)
   org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:46)

Looking into the DB, I've found the deployment has been recorded into the act_re_deployment
mysql> select * from act_re_deployment;
+—–+———-+———————+
| ID_ | NAME_    | DEPLOY_TIME_        |
+—–+———-+———————+
| 1     | MYDEPLOY  | 2012-04-24 22:21:39 |
+—–+———-+———————+
However no data is found in act_re_procdef
mysql> select * from act_re_procdef;
Empty set (0.00 sec)
So it seems the deployment is not persisted. Can you give me any clue ?
Thanks a lot
Frank

Outcomes