Can't deploy BpmnModel by using createDeployment

I would like add programmatically bpmn model.
I create BpmnModel and next save to xml class.
Loading mode by xml file l in configuration or by createDeployment it works:
(xml file change_bank_account.bpmn20.xml was generated from model by BpmnXMLConverter.

1. It works
processEngineConfiguration.setDeploymentResources(
new Resource[] {
new ClassPathResource(“business_processes_xmls/change_bank_account.bpmn20.xml”)

       });

2. It works:
BpmnModel model = changeBankAccountBpmnModel.createModel();
repositoryService.createDeployment()
.name(“ChangeBankAccountProcess-deployment”)
.addClasspathResource(“business_processes_xmls/change_bank_account.bpmn20.xml”)
.deploy();

3. It does not work:
BpmnModel model = changeBankAccountBpmnModel.createModel();
repositoryService.createDeployment()
.name(“ChangeBankAccountProcess-deployment”)
.addBpmnModel(“ChangeBankAccountProcess”,model)
.deploy();

Also it does not work by: addInputStream.

Thank you for your help.
Mirek

I have found solution :-).

Resource name has to have extension .bpmn

It works when I changed to:
.addBpmnModel(“ChangeBankAccountProcess.bpmn”,model)
also for addInputStream
:slight_smile:

2 Likes