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<ProcessDefinition> 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?
Thanks for your help
It turned out that the issue was related to definitionName (thanks thorben!) as it has to ends on either .bpmn20.xml or .bpmn.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With