Examples of BpmnXMLConverter


Examples of org.activiti.bpmn.converter.BpmnXMLConverter

                + "' in deployment '" + processDefinitionEntity.getDeploymentId() + "'", InputStream.class);
      }
    }
   
    // Convert the bpmn 2.0 xml to a bpmn model
    BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
    return bpmnXMLConverter.convertToBpmnModel(new BytesStreamSource(resource.getBytes()), false, false); // no need to validate schema, it was already validated on deploy
  }
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

    }
    return this;
  }
 
  public DeploymentBuilder addBpmnModel(String resourceName, BpmnModel bpmnModel) {
    BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
    try {
      String bpmn20Xml = new String(bpmnXMLConverter.convertToXML(bpmnModel), "UTF-8");
      addString(resourceName, bpmn20Xml);
    } catch (UnsupportedEncodingException e) {
      throw new ActivitiException("Errot while transforming BPMN model to xml: not UTF-8 encoded", e);
    }
    return this;
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

         
          final InputStream definitionStream = repositoryService.getResourceAsStream(
              processDefinition.getDeploymentId(), processDefinition.getResourceName());
          XMLInputFactory xif = XmlUtil.createSafeXmlInputFactory();
          XMLStreamReader xtr = xif.createXMLStreamReader(definitionStream);
          BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
         
          if (!bpmnModel.getFlowLocationMap().isEmpty()) {
           
            int maxX = 0;
            int maxY = 0;
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

  protected JAXBContext beansJaxbContext;
  protected JAXBContext moduleJaxbContext;

  public AlfrescoArtifactExporter() {
    // Initialize writers for artifacts
    bpmnConverter = new BpmnXMLConverter();
    try {
      modelJaxbContext = JAXBContext.newInstance(M2Model.class);
      moduleJaxbContext = JAXBContext.newInstance(Extension.class, Module.class, AlfrescoConfiguration.class, ModuleDeployment.class);
      beansJaxbContext = JAXBContext.newInstance(Beans.class);
    } catch (JAXBException jaxbe) {
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

       
        final InputStream definitionStream = repositoryService.getResourceAsStream(
            processDefinition.getDeploymentId(), processDefinition.getResourceName());
        XMLInputFactory xif = XmlUtil.createSafeXmlInputFactory();
        XMLStreamReader xtr = xif.createXMLStreamReader(definitionStream);
        BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
       
        if (!bpmnModel.getFlowLocationMap().isEmpty()) {
         
          int maxX = 0;
          int maxY = 0;
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

    process.addFlowElement(flow1);
    EndEvent endEvent = new EndEvent();
    endEvent.setId("endEvent1");
    process.addFlowElement(endEvent);
   
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel);
   
    new BpmnXMLConverter().validateModel(new InputStreamSource(new ByteArrayInputStream(xml)));
   
    Deployment deployment = repositoryService.createDeployment().name("test").addString("test.bpmn20.xml", new String(xml)).deploy();
    repositoryService.deleteDeployment(deployment.getId());
  }
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

                        throw new IllegalArgumentException(
                                "Could not find JSON node " + BpmnJsonConverter.EDITOR_CHILD_SHAPES);
                    }

                    BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(definitionNode);
                    importUtils.fromXML(new BpmnXMLConverter().convertToXML(bpmnModel));
                } catch (Exception e) {
                    throw new WorkflowException("While updating process "
                            + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
                }
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

        try {
            bpmnStream = repositoryService.getResourceAsStream(
                    procDef.getDeploymentId(), procDef.getResourceName());
            isr = new InputStreamReader(bpmnStream);
            xtr = XMLInputFactory.newInstance().createXMLStreamReader(isr);
            BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);

            fromJSON(new BpmnJsonConverter().convertToJson(bpmnModel).toString().getBytes(), procDef, model);
        } catch (Exception e) {
            throw new WorkflowException("While updating process " + ActivitiUserWorkflowAdapter.WF_PROCESS_RESOURCE, e);
        } finally {
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

    BpmnModel parsedModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
    return parsedModel;
  }
 
  protected void deployProcess(BpmnModel bpmnModel)  {
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel);
    ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
    ProcessEngine processEngine = configuration.buildProcessEngine();
    try {
      Deployment deployment = processEngine.getRepositoryService().createDeployment().name("test").addString("test.bpmn20.xml", new String(xml)).deploy();
      processEngine.getRepositoryService().deleteDeployment(deployment.getId());
View Full Code Here

Examples of org.activiti.bpmn.converter.BpmnXMLConverter

      // add sequence flow bend-points to the model
      final IFeatureProvider featureProvider = getDiagramTypeProvider().getFeatureProvider();
      new GraphitiToBpmnDI(model, featureProvider).processGraphitiElements();

      BpmnXMLConverter converter = new BpmnXMLConverter();
      byte[] xmlBytes = converter.convertToXML(model.getBpmnModel());

      File objectsFile = new File(diagramFileString);
      FileOutputStream fos = new FileOutputStream(objectsFile);
      fos.write(xmlBytes);
      fos.close();
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.