cancel
Showing results for 
Search instead for 
Did you mean: 

deployment didn't put process definition in the cache

mkrech
Champ in-the-making
Champ in-the-making
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());
  }
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

could you create jUnit test please?
http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin