As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
String deploymentName; if (workFlow.getModule().isInDevelopment()) { deploymentName = workFlow.getName() + "_" + System.currentTimeMillis(); } else { deploymentName = workFlow.getName() + "_" + workFlow.getModule().getVersion(); } deploymentName += ".bpnm20.xml"; final Deployment deployment = repositoryService.createDeploymentQuery() .deploymentName(deploymentName).singleResult(); if (deployment == null) { final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment() .enableDuplicateFiltering().name(deploymentName); if (workFlow.getImagePath() != null) { deploymentBuilder.addInputStream(workFlow.getImagePath(), this.getClass() .getResourceAsStream("/" + workFlow.getImagePath())); } deploymentBuilder.addInputStream(deploymentName, new ByteArrayInputStream(workFlow .getWorkflow().getBytes("UTF-8"))); deploymentBuilder.deploy(); }