I’m trying to deploy a process definition from a file using the following code
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().name(definitionName);
deploymentBuilder.addInputStream(definitionName, definitionFileInputStream);
String deploymentId = deploymentBuilder.deploy().getId();
System.out.println(deploymentId);
The above code runs successfully and the new deploymentId is printed out.
Later, I tried to list the deployed process definitions using the following code
List definitions = repositoryService.createProcessDefinitionQuery().list();
System.out.println(definitions.size());
The above code runs successfully but the output is always 0.
I’ve done some investigations and found that in the ACT_GE_BYTEARRAY table an entry with the corresponding deploymentId exists and the BYTES_ column contains that contents of the definitions file.
I have also found that there is no corresponding entry found in ACT_RE_PROCDEF table.
Is there something messing? from the API and the examples I found it seems that the above code shall suffice, or is there a missing step?
Make sure that definitionName ends on either .bpmn20.xml or .bpmn. Only then will the process engine interpret a deployment resource as a BPMN process definition.
After further testing, the suffix is required for the following definitionName of the code deploymentBuilder.addInputStream(definitionName, definitionFileInputStream);
Leaving the following definitionName without the suffix is fine repositoryService.createDeployment().name(definitionName);
where can I find the Camunda log file? Currently I use an embedded engine that is locally started via Spring Boot and Eclipse.
In the meantime I was succesful:
I created another BPMN file “Review.bpmn” with the Camunda Modeler and put the BPMN file into the ./diagrams folder of my Spring Boot project. When I start the application, everything works fine, the process will automatically be started during bootstrapping.
Than I stopped my application and moved the “Review.bpmn” file from the ./diagram folder to another folder.
Afterwards I re-started my application and picked the file during runtime via upload functionality of my UI. This functionality executes the above mentioned code. In this scenario I use