Examples of BpmnXMLConverter


Examples of org.activiti.bpmn.converter.BpmnXMLConverter

            } else {
              JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
              BpmnJsonConverter jsonConverter = new BpmnJsonConverter();
              BpmnModel model = jsonConverter.convertToBpmnModel(editorNode);
              filename = model.getMainProcess().getId() + ".bpmn20.xml";
              bpmnBytes = new BpmnXMLConverter().convertToXML(model);
            }
          
            ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes);
            ds = new DownloadStream(in, "application/xml", filename);
            // Need a file download POPUP
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

    deployModelPopupWindow.showPopupWindow();
  }
 
  protected void deployModelerModel(final ObjectNode modelNode) {
    BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
    byte[] bpmnBytes = new BpmnXMLConverter().convertToXML(model);
   
    String processName = modelData.getName() + ".bpmn20.xml";
    Deployment deployment = repositoryService.createDeployment()
            .name(modelData.getName())
            .addString(processName, new String(bpmnBytes))
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

        try {
          InputStream bpmnStream = repositoryService.getResourceAsStream(processDefinition.getDeploymentId(), processDefinition.getResourceName());
          XMLInputFactory xif = XmlUtil.createSafeXmlInputFactory();
          InputStreamReader in = new InputStreamReader(bpmnStream, "UTF-8");
          XMLStreamReader xtr = xif.createXMLStreamReader(in);
          BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
         
          if (bpmnModel.getMainProcess() == null || bpmnModel.getMainProcess().getId() == null) {
            notificationManager.showErrorNotification(Messages.MODEL_IMPORT_FAILED,
                i18nManager.getMessage(Messages.MODEL_IMPORT_INVALID_BPMN_EXPLANATION));
          } else {
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

   
    InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream("org/activiti/engine/test/validation/invalidProcess.bpmn20.xml");
    XMLInputFactory xif = XMLInputFactory.newInstance();
    InputStreamReader in = new InputStreamReader(xmlStream, "UTF-8");
    XMLStreamReader xtr = xif.createXMLStreamReader(in);
    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
    Assert.assertNotNull(bpmnModel);
   
    List<ValidationError> allErrors = processValidator.validate(bpmnModel);
    Assert.assertEquals(66, allErrors.size());
   
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

        "</definitions>";   

      XMLInputFactory xif = XMLInputFactory.newInstance();
      InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(flowWithoutConditionNoDefaultFlow.getBytes()), "UTF-8");
      XMLStreamReader xtr = xif.createXMLStreamReader(in);
      BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
      Assert.assertNotNull(bpmnModel);
      List<ValidationError> allErrors = processValidator.validate(bpmnModel);
      Assert.assertEquals(1, allErrors.size());
      Assert.assertTrue(allErrors.get(0).isWarning());
  }
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

  protected void deployUploadedFile() {
    try {
      try {
        if (fileName.endsWith(".bpmn20.xml") || fileName.endsWith(".bpmn")) {
          validFile = true;
          BpmnXMLConverter xmlConverter = new BpmnXMLConverter();
          XMLInputFactory xif = XmlUtil.createSafeXmlInputFactory();
          InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray()), "UTF-8");
          XMLStreamReader xtr = xif.createXMLStreamReader(in);
          BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
          xmlConverter.convertToBpmnModel(xtr);
         
          if (bpmnModel.getMainProcess() == null || bpmnModel.getMainProcess().getId() == null) {
            notificationManager.showErrorNotification(Messages.MODEL_IMPORT_FAILED,
                i18nManager.getMessage(Messages.MODEL_IMPORT_INVALID_BPMN_EXPLANATION));
          } else {
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

  }
 
  protected BpmnModel readXMLFile() throws Exception {
    InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream(getResource());
    StreamSource xmlSource = new InputStreamSource(xmlStream);
    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return bpmnModel;
  }
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return bpmnModel;
  }
 
  protected BpmnModel exportAndReadXMLFile(BpmnModel bpmnModel) throws Exception {
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel, processEngineConfiguration.getXmlEncoding());
    StreamSource xmlSource = new InputStreamSource(new ByteArrayInputStream(xml));
    BpmnModel parsedModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return parsedModel;
  }
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

    BpmnModel parsedModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return parsedModel;
  }
 
  protected void deployProcess(BpmnModel bpmnModel)  {
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel);
    try {
      Deployment deployment = processEngine.getRepositoryService().createDeployment().name("test").addString("test.bpmn20.xml", new String(xml)).deploy();
      processEngine.getRepositoryService().deleteDeployment(deployment.getId());
    } finally {
      processEngine.close();
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

 
  public BpmnParse execute() {
    try {

      ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
      BpmnXMLConverter converter = new BpmnXMLConverter();
     
      boolean enableSafeBpmnXml = false;
      String encoding = null;
      if (processEngineConfiguration != null) {
        enableSafeBpmnXml = processEngineConfiguration.isEnableSafeBpmnXml();
        encoding = processEngineConfiguration.getXmlEncoding();
      }
     
      if (encoding != null) {
        bpmnModel = converter.convertToBpmnModel(streamSource, validateSchema, enableSafeBpmnXml, encoding);
      } else {
        bpmnModel = converter.convertToBpmnModel(streamSource, validateSchema, enableSafeBpmnXml);
      }
     
      // XSD validation goes first, then process/semantic validation
      if (validateProcess) {
        ProcessValidator processValidator = processEngineConfiguration.getProcessValidator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.