AnsweredAssumed Answered

deployment didn't put process definition in the cache

Question asked by mkrech on Aug 25, 2015
Latest reply on Aug 26, 2015 by martin.grofcik
I am trying to programatically start an existing Activiti model.  I am currently running in the 'parent' model and it is hitting a Java service task.  This Java service task then attempts to set up and call the model in question.  I am running through Activiti-Explorer and have manually deployed the two diagrams through the web interface.

The code will successfully execute the startProcessInstanceByKey method, but when the class goes to move on it will fail with "deployment didn't put process definition in the cache".  So then I added in the System.out to output the size of the Task list.  Now when that tries to execute it is giving me that error.  I'm not sure what is wrong with the code.  I have also attached the stack trace.

public void execute(DelegateExecution execution) throws Exception
      ArrayList<String> agreements = (ArrayList<String>) execution.getVariable("agreements");
      String misappropriatedSecret = (String) execution.getVariable("misappropriatedTradeSecret");
      if (agreements == null)
         agreements = new ArrayList<String>();
      System.out.println("Current agreements:\n");
      for(String agreement : agreements)
         System.out.println("   " + agreement);
      ProcessInstance processInstance = null;
      ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault().buildProcessEngine();
      RuntimeService runtimeService = processEngine.getRuntimeService();
//         Start a process instance
         runtimeService.setVariable(execution.getId(), "agreements", agreements);
         runtimeService.setVariable(execution.getId(), "misappropriatedSecret", misappropriatedSecret);
         processInstance = runtimeService.startProcessInstanceByKey("ThereIsMisappropriation");
         List tasks = processEngine.getTaskService().createTaskQuery().processInstanceId(processInstance.getId()).list();
         if (tasks == null)
            tasks = new ArrayList<String>();
         System.out.println("Current tasks size:\n" + tasks.size());