cancel
Showing results for 
Search instead for 
Did you mean: 

Two places for process definition identifier on deployment?

klemens
Champ in-the-making
Champ in-the-making
Hi,

I am wondering why it is necessary to provide the process definition two times during deployment. The first time I need to give it to the the method call:

repositoryService.createDeployment().addInputStream(identifier, inputStream).deploy();
and the second time I need to specify it inside the id element of the process definition.

Now I have the scenario where a user uploads workflow definitions to a server. The server executes the workflows based on these definitions. The problem is, that the user can not know which identifiers where used by other users to upload worklfows, so I need to assign identifiers on the server side. This is only possible by exchanging the identifier in the process definition, which requires me to parse the XML on the server side. That is quite ugly, since I had hoped that the identifier provided to the "addInputStream" method would be sufficient to call access the workflow definition later on.
13 REPLIES 13

jbarrez
Star Contributor
Star Contributor
Hmmm that might be a bug then … but indeed, the targetNamespace can be used to set the category too.

I'll look into the issue with programmicatlly setting the category and get back to you.

jbarrez
Star Contributor
Star Contributor
Ok, i checked the code.

The category() on the deployment is different from the category on a process definition.
The process definition category is indeed derived from the targetNameSpace. I don't see a way to hange it programmatically.

However, you might be able to first convert to a BpmnModel, change the targetNameSpace and call the addBpmnModel() method on the DeploymentBuilder.

chen4613
Champ in-the-making
Champ in-the-making
Thank you Joram, I can deploy same bpmn with different purposes now.

jesus
Champ in-the-making
Champ in-the-making
How can I do that?

Please, put your code here chen4613. Tks!