Unit Testing for versions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2014 12:15 PM
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
error : org.activiti.engine.ActivitiException: The deployment contains process definitions with the same key (process id atrribute), this is not allowed
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
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2014 03:27 AM
Hi Yohann.
Each process in one deployment has to have unique key.
Regards
Martin
{"com/yo/poc/rest/CallActivityTest.myfirstMainProcess010.bpmn20.xml",
"com/yo/poc/rest/CallActivityTest.myfirstCalledProcess010.bpmn20.xml",
"com/yo/poc/rest/CallActivityTest.myfirstCalledProcess020.bpmn20.xml"})
Do your processes have same key?Each process in one deployment has to have unique key.
Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2014 09:26 AM
Yes they do have the same key.
And it make sens that for a deployment those should be unique.
But in order to test two versions of the same workflow, i need those two process definition that have the same id.
So what I'll try to deploy twice, but it looks like I can't do that with the @Deployment annotation.
Thanks Martin
And it make sens that for a deployment those should be unique.
But in order to test two versions of the same workflow, i need those two process definition that have the same id.
So what I'll try to deploy twice, but it looks like I can't do that with the @Deployment annotation.
Thanks Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2014 04:53 AM
No, the @Deployment can't have the same id twice. You will need to inspire you with that annotation and write one that does indeed do multiple deployments (one/file). Shouldn't be hard to do that I believe.
