Roland
December 3, 2017, 5:17pm
1
Hi,
so far I used java.io.Files and the repositoryServcie to deploy a process into the workflowengine
DeploymentWithDefinitions d = repositoryService.createDeployment()
.addInputStream(fileName,new FileInputStream(convFile))
.name(fileName)
.deployWithResult();
But what if I only have a BPMN-String available? How do I deploy a BPMN-String?
Thnaks and best regards
Roland
Hi,
the addInputStream method just needs an input stream. Hence you could probably replace FileInputStream with something like;
InputStream is = new ByteArrayInputStream(str.getBytes());
where str is your String
regards
Rob
Roland
December 4, 2017, 8:05pm
4
Hi Rob, Thorben
thanks for your reply. I tried the addString() method. Works like charme. The only thing one has to remember is to put the “.bpmn” suffix to the resourcename, otherwise the deployment will fail.
See suffix requirements for resource names: https://docs.camunda.org/javadoc/camunda-bpm-platform/7.8/org/camunda/bpm/engine/repository/DeploymentBuilder.html .
Thank you very much
Roland
1 Like