cancel
Showing results for 
Search instead for 
Did you mean: 

How can I deploy multiple versions of the same process in a test

felipe1
Champ in-the-making
Champ in-the-making
I have a scenario to test which depends on having more than one version of a given process deployed to the engine.

I'm using the

@Deployment(resources = { "process/test.bpmn" })

annotation on other tests and it works just fine.

Here are some attempts I made, but they've all failed:

1-
@Deployment(resources = { "process/test.bpmn", "process/test.bpmn", "process/test.bpmn", "process/test.bpmn" }) 


Does not generate error, but only one process is deployed

2-
@Deployment(resources = { "process/test.bpmn", "process/test-2.bpmn", "process/test-3.bpmn", "process/test-4.bpmn" }) 


where test-2.bpmn, test-3.bpmn and test-4.bpmn are copies of test.bpmn.
This generates the following error:
org.activiti.engine.ActivitiException: The deployment contains process definitions with the same key (process id atrribute), this is not allowed


3-

InputStream is = this.getClass().getResource("/process/test.bpmn"));
activitiRule.getRepositoryService().createDeployment().name("test").addInputStream("test", is).deploy();
activitiRule.getRepositoryService().createDeployment().name("test").addInputStream("test", is).deploy();
activitiRule.getRepositoryService().createDeployment().name("test").addInputStream("test", is).deploy();
activitiRule.getRepositoryService().createDeployment().name("test").addInputStream("test", is).deploy();

This does not deploy any process to the engine

2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
for example


String deploymentId = repositoryService
      .createDeployment()
      .addClasspathResource("org/activiti/engine/test/bpmn/event/message/MessageStartEventTest.testSingleMessageStartEvent.bpmn20.xml")
      .deploy()
      .getId();
2x

Regards
Martin

felipe1
Champ in-the-making
Champ in-the-making
Great Martin. It worked perfectly!

Cheers!