AnsweredAssumed Answered

Unit Testing for versions

Question asked by zze_one on Mar 12, 2014
Latest reply on Mar 17, 2014 by jbarrez
Hi,

I'm currently working on a customized version management of workflows.
So far so good, everything is working fine: A main process can call a specific version of a subprocess.

So next step is for me to write unit tests for this implementation.
For this, I simply need to deploy a main process, two sub processes, and direct my call activity to the correct sub process.

Unfortunately, using Activiti unit testing methodology, it looks like I can't deploy 2 bpmn files that have the same key (the equivalent of deploying twice the same bpmn file).

Is there a way for me to achieve this ?
Bellow is my simplified code and the error i get.

Thanks a lot,

Yohann


   @Deployment(resources = {"com/yo/poc/rest/CallActivityTest.myfirstMainProcess010.bpmn20.xml",
    "com/yo/poc/rest/CallActivityTest.myfirstCalledProcess010.bpmn20.xml",
    "com/yo/poc/rest/CallActivityTest.myfirstCalledProcess020.bpmn20.xml"})
   public void testMainProcessCallingLatestSubProcess() throws Exception {

      try {
      
         //TODO wrong if some process still in the db –> do your own test db
         List<ProcessDefinition> procDefs = repositoryService.createProcessDefinitionQuery().list();
         assertEquals(3, procDefs.size());
         
      } catch (Exception e) {
         Assert.fail("Something is wrong: " + e);
      }
      
   }


error : org.activiti.engine.ActivitiException: The deployment contains process definitions with the same key (process id atrribute), this is not allowed

Outcomes