Java Code Examples for org.activiti.engine.repository.DeploymentBuilder#addInputStream()

The following examples show how to use org.activiti.engine.repository.DeploymentBuilder#addInputStream() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultAutoDeploymentStrategy.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
@Override
public void deployResources(final String deploymentNameHint, final Resource[] resources, final RepositoryService repositoryService) {

  // Create a single deployment for all resources using the name hint as
  // the
  // literal name
  final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentNameHint);

  for (final Resource resource : resources) {
    final String resourceName = determineResourceName(resource);

    try {
      if (resourceName.endsWith(".bar") || resourceName.endsWith(".zip") || resourceName.endsWith(".jar")) {
        deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));
      } else {
        deploymentBuilder.addInputStream(resourceName, resource.getInputStream());
      }
    } catch (IOException e) {
      throw new ActivitiException("couldn't auto deploy resource '" + resource + "': " + e.getMessage(), e);
    }
  }

  deploymentBuilder.deploy();

}
 
Example 2
Source File: SingleResourceAutoDeploymentStrategy.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
@Override
public void deployResources(final String deploymentNameHint, final Resource[] resources, final RepositoryService repositoryService) {

  // Create a separate deployment for each resource using the resource
  // name

  for (final Resource resource : resources) {

    final String resourceName = determineResourceName(resource);
    final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName);

    try {
      if (resourceName.endsWith(".bar") || resourceName.endsWith(".zip") || resourceName.endsWith(".jar")) {
        deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));
      } else {
        deploymentBuilder.addInputStream(resourceName, resource.getInputStream());
      }
    } catch (IOException e) {
      throw new ActivitiException("couldn't auto deploy resource '" + resource + "': " + e.getMessage(), e);
    }

    deploymentBuilder.deploy();
  }
}
 
Example 3
Source File: EnterpriseWorkflowTestApi.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected String deployProcessDefinition(String... artifacts) {
    DeploymentBuilder deploymentBuilder = activitiProcessEngine.getRepositoryService().createDeployment();
    boolean firstArtifact = true;
    for (String artifact : artifacts)
    {
        InputStream bpmnInputStream = getClass().getClassLoader().getResourceAsStream(artifact);
        String name = artifact.substring(artifact.lastIndexOf("/") + 1);
        if (firstArtifact)
        {
            deploymentBuilder.name(name);
        }
        deploymentBuilder.addInputStream(name, bpmnInputStream);
    }
    String deploymentId = deploymentBuilder.deploy().getId();
    return deploymentId;
}
 
Example 4
Source File: SingleResourceAutoDeploymentStrategy.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
@Override
public void deployResources(final String deploymentNameHint, final Resource[] resources, final RepositoryService repositoryService) {

    // Create a separate deployment for each resource using the resource
    // name

    for (final Resource resource : resources) {

        final String resourceName = determineResourceName(resource);
        final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(resourceName);

        try {
            if (resourceName.endsWith(".bar") || resourceName.endsWith(".zip") || resourceName.endsWith(".jar")) {
                deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));
            } else {
                deploymentBuilder.addInputStream(resourceName, resource.getInputStream());
            }
        } catch (IOException e) {
            throw new ActivitiException("couldn't auto deploy resource '" + resource + "': " + e.getMessage(), e);
        }

        deploymentBuilder.deploy();
    }
}
 
Example 5
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 6
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 7
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 8
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 9
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:processes";
}
 
Example 10
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 11
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 12
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 13
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 14
Source File: ResourceParentFolderAutoDeploymentStrategy.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Override
public void deployResources(final String deploymentNameHint, final Resource[] resources, final RepositoryService repositoryService) {

    // Create a deployment for each distinct parent folder using the name
    // hint
    // as a prefix
    final Map<String, Set<Resource>> resourcesMap = createMap(resources);

    for (final Entry<String, Set<Resource>> group : resourcesMap.entrySet()) {

        final String deploymentName = determineDeploymentName(deploymentNameHint, group.getKey());

        final DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().enableDuplicateFiltering().name(deploymentName);

        for (final Resource resource : group.getValue()) {
            final String resourceName = determineResourceName(resource);

            try {
                if (resourceName.endsWith(".bar") || resourceName.endsWith(".zip") || resourceName.endsWith(".jar")) {
                    deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));
                } else {
                    deploymentBuilder.addInputStream(resourceName, resource.getInputStream());
                }
            } catch (IOException e) {
                throw new ActivitiException("couldn't auto deploy resource '" + resource + "': " + e.getMessage(), e);
            }
        }
        deploymentBuilder.deploy();
    }

}
 
Example 15
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 16
Source File: FlowableDeploymentController.java    From hsweb-framework with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 * 加载ZIP文件中的流程
 */
@PostMapping(value = "/deploy")
@ApiOperation("上传流程定义文件并部署流程")
@Authorize(action = "deploy")
public ResponseMessage<Deployment> deploy(@RequestPart(value = "file") MultipartFile file) throws IOException {
    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    // 得到输入流(字节流)对象
    InputStream fileInputStream = file.getInputStream();

    // 文件的扩展名
    String extension = FilenameUtils.getExtension(fileName);

    // zip或者bar类型的文件用ZipInputStream方式部署
    DeploymentBuilder deployment = repositoryService.createDeployment();
    if ("zip".equals(extension) || "bar".equals(extension)) {
        ZipInputStream zip = new ZipInputStream(fileInputStream);
        deployment.addZipInputStream(zip);
    } else {
        // 其他类型的文件直接部署
        deployment.addInputStream(fileName, fileInputStream);
    }
    Deployment result = deployment.deploy();

    return ResponseMessage.ok(result);
}
 
Example 17
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 18
Source File: DeploymentController.java    From activiti-in-action-codes with Apache License 2.0 5 votes vote down vote up
/**
 * 部署流程资源
 */
@RequestMapping(value = "/deploy")
public String deploy(@RequestParam(value = "file", required = true) MultipartFile file) {

    // 获取上传的文件名
    String fileName = file.getOriginalFilename();

    try {
        // 得到输入流(字节流)对象
        InputStream fileInputStream = file.getInputStream();

        // 文件的扩展名
        String extension = FilenameUtils.getExtension(fileName);

        // zip或者bar类型的文件用ZipInputStream方式部署
        DeploymentBuilder deployment = repositoryService.createDeployment();
        if (extension.equals("zip") || extension.equals("bar")) {
            ZipInputStream zip = new ZipInputStream(fileInputStream);
            deployment.addZipInputStream(zip);
        } else {
            // 其他类型的文件直接部署
            deployment.addInputStream(fileName, fileInputStream);
        }
        deployment.deploy();
    } catch (Exception e) {
        logger.error("error on deploy process, because of file input stream");
    }

    return "redirect:process-list";
}
 
Example 19
Source File: DeploymentCollectionResource.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
@ApiOperation(value = "Create a new deployment", tags = {"Deployment"}, consumes = "multipart/form-data", produces = "application/json",
    notes = "The request body should contain data of type multipart/form-data. There should be exactly one file in the request, any additional files will be ignored. If multiple resources need to be deployed in a single deployment, compress the resources in a zip and make sure the file-name ends with .bar or .zip.\n"
        + "\n"
        + "An additional parameter (form-field) can be passed in the request body with name tenantId. The value of this field will be used as the id of the tenant this deployment is done in.")
@ApiResponses(value = {
    @ApiResponse(code = 200, message = "Indicates the deployment was created."),
    @ApiResponse(code = 400, message = "Indicates there was no content present in the request body or the content mime-type is not supported for deployment. The status-description contains additional information.")
})
@RequestMapping(value = "/repository/deployments", method = RequestMethod.POST, produces = "application/json")
public DeploymentResponse uploadDeployment(@ApiParam(name = "tenantId") @RequestParam(value = "tenantId", required = false) String tenantId, HttpServletRequest request, HttpServletResponse response) {

  if (request instanceof MultipartHttpServletRequest == false) {
    throw new ActivitiIllegalArgumentException("Multipart request is required");
  }

  MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;

  if (multipartRequest.getFileMap().size() == 0) {
    throw new ActivitiIllegalArgumentException("Multipart request with file content is required");
  }

  MultipartFile file = multipartRequest.getFileMap().values().iterator().next();

  try {
    DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();
    String fileName = file.getOriginalFilename();
    if (StringUtils.isEmpty(fileName) || !(fileName.endsWith(".bpmn20.xml") || fileName.endsWith(".bpmn") || fileName.toLowerCase().endsWith(".bar") || fileName.toLowerCase().endsWith(".zip"))) {

      fileName = file.getName();
    }

    if (fileName.endsWith(".bpmn20.xml") || fileName.endsWith(".bpmn")) {
      deploymentBuilder.addInputStream(fileName, file.getInputStream());
    } else if (fileName.toLowerCase().endsWith(".bar") || fileName.toLowerCase().endsWith(".zip")) {
      deploymentBuilder.addZipInputStream(new ZipInputStream(file.getInputStream()));
    } else {
      throw new ActivitiIllegalArgumentException("File must be of type .bpmn20.xml, .bpmn, .bar or .zip");
    }
    deploymentBuilder.name(fileName);

    if (tenantId != null) {
      deploymentBuilder.tenantId(tenantId);
    }

    Deployment deployment = deploymentBuilder.deploy();

    response.setStatus(HttpStatus.CREATED.value());

    return restResponseFactory.createDeploymentResponse(deployment);

  } catch (Exception e) {
    if (e instanceof ActivitiException) {
      throw (ActivitiException) e;
    }
    throw new ActivitiException(e.getMessage(), e);
  }
}
 
Example 20
Source File: DeploymentServiceImpl.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
@Override
@Transactional
public Deployment updateAppDefinition(Model appDefinitionModel, User user) {
  Deployment deployment = null;
  AppDefinition appDefinition = resolveAppDefinition(appDefinitionModel);

  if (CollectionUtils.isNotEmpty(appDefinition.getModels())) {
    DeploymentBuilder deploymentBuilder = repositoryService.createDeployment()
        .name(appDefinitionModel.getName())
        .key(appDefinitionModel.getKey());
    
    Map<String, Model> formMap = new HashMap<String, Model>();
    Map<String, Model> decisionTableMap = new HashMap<String, Model>();

    for (AppModelDefinition appModelDef : appDefinition.getModels()) {

      AbstractModel processModel = modelService.getModel(appModelDef.getId());
      if (processModel == null) {
        logger.error("Model " + appModelDef.getId() + " for app definition " + appDefinitionModel.getId() + " could not be found");
        throw new BadRequestException("Model for app definition could not be found");
      }
      
      List<Model> referencedModels = modelRepository.findModelsByParentModelId(processModel.getId());
      for (Model childModel : referencedModels) {
        if (Model.MODEL_TYPE_FORM == childModel.getModelType()) {
          formMap.put(childModel.getId(), childModel);
          
        } else if (Model.MODEL_TYPE_DECISION_TABLE == childModel.getModelType()) {
          decisionTableMap.put(childModel.getId(), childModel);
        }
      }

      BpmnModel bpmnModel = modelService.getBpmnModel(processModel, formMap, decisionTableMap);
      Map<String, StartEvent> startEventMap = processNoneStartEvents(bpmnModel);
      
      for (Process process : bpmnModel.getProcesses()) {
        processUserTasks(process.getFlowElements(), process, startEventMap);
      }
      
      byte[] modelXML = modelService.getBpmnXML(bpmnModel);
      deploymentBuilder.addInputStream(processModel.getKey().replaceAll(" ", "") + ".bpmn", new ByteArrayInputStream(modelXML));
    }
    
    if (formMap.size() > 0) {
      for (String formId : formMap.keySet()) {
        Model formInfo = formMap.get(formId);
        deploymentBuilder.addString("form-" + formInfo.getKey() + ".form", formInfo.getModelEditorJson());
      }
    }
    
    if (decisionTableMap.size() > 0) {
      for (String decisionTableId : decisionTableMap.keySet()) {
        Model decisionTableInfo = decisionTableMap.get(decisionTableId);
        try {
          JsonNode decisionTableNode = objectMapper.readTree(decisionTableInfo.getModelEditorJson());
          DmnDefinition dmnDefinition = dmnJsonConverter.convertToDmn(decisionTableNode, decisionTableInfo.getId(), 
              decisionTableInfo.getVersion(), decisionTableInfo.getLastUpdated());
          byte[] dmnXMLBytes = dmnXMLConverter.convertToXML(dmnDefinition);
          deploymentBuilder.addBytes("dmn-" + decisionTableInfo.getKey() + ".dmn", dmnXMLBytes);
          
        } catch (Exception e) {
          logger.error("Error converting decision table to XML " + decisionTableInfo.getName(), e);
          throw new InternalServerErrorException("Error converting decision table to XML " + decisionTableInfo.getName());
        }
      }
    }

    deployment = deploymentBuilder.deploy();
  }

  return deployment;
}