AnsweredAssumed Answered

no processes deployed with key 'XYZ'

Question asked by ad1 on May 20, 2016
Latest reply on May 31, 2016 by jbarrez
I have the following function in a java class called   to crate a Process XYZ. It goes fine for the first time and creates the process.  The key is XYZ. When called again i get a error
no processes deployed with key 'XYZ'. My BPMn sxml and the java code is given below. What could be the issue?


<process id="XZY" name="XYZ Process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <serviceTask id="CreateTask" name="Create Task" activiti:async="true" activiti:expression="${TaskManager.createTask(execution.getId())}"></serviceTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="CreateTask"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="CreateTask" targetRef="endevent1"></sequenceFlow>
  </process>









protected ProcessInstance initProcessInstance(String processKey, Map variables) {
      System.out.println("1. Inside initProcessInstance for " + processKey);
      ProcessInstance processInstance = null;
      
      System.out.println("2. Inside initProcessInstance for " + processKey);
      RuntimeService runTimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService();
      
      System.out.println("3. Inside initProcessInstance for " + runTimeService);
      if (variables == null) {
         System.out.println("4. Inside initProcessInstance for " + variables);
         processInstance = runTimeService.startProcessInstanceByKey(processKey);
         
      } else {
         System.out.println("5. Inside initProcessInstance for " + variables);
         processInstance = runTimeService.startProcessInstanceByKey(processKey, variables);
      }
      
      System.out.println("6. Inside initProcessInstance for " + variables);
      
      
      
      return processInstance;
   }

Outcomes