Package com.founder.fix.fixflow.bpmn.converter

Examples of com.founder.fix.fixflow.bpmn.converter.FixFlowConverter


  public void loadBPMNJson(){
    PrintWriter out = null;
    try {
      out = response.getWriter();
            InputStream input = new FileInputStream(buildPath() +File.separator+request.getParameter("fileName"));
        ObjectNode on = new FixFlowConverter().convertBpmn2Json("process_testych", input);
        out.print(on);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }finally{
          out.flush();
View Full Code Here


      String resFilePath = getBasePath(this.request)+"temp"+File.separator+"node_template.bpmn";;
      String newFilePath = buildPath(body)+File.separator+fileName;
      String staticFilePath = getBasePath(this.request)+"template"+File.separator+"node_template.bpmn";
        //保存思想:因为save方法不一定保存成功,并且保存失败后会导致原有文件丢失,所以做了个临时保存,没问题再复制过去
        FileUtil.copyFile(staticFilePath, resFilePath);
        new FixFlowConverter().save(objectNode,URI.createFileURI(resFilePath));
          FileUtil.copyFile(resFilePath, newFilePath);
         
          //png图片处理
          String pngPath = newFilePath.substring(0,newFilePath.lastIndexOf(".")) + ".png";
        File file = new File(pngPath);
View Full Code Here

   * 二次请求模型信息
   */
  public void reTryModelInfo(){
    PrintWriter out = null;
    try {
      FixFlowConverter fixFlowConverter = new FixFlowConverter();
     
        ObjectMapper objectMapper = new ObjectMapper();
            InputStream input = new FileInputStream(buildPath() +File.separator+request.getParameter("fileName"));
            Definitions definitions = fixFlowConverter.getDefinitions("process_1", input);
            Process process = (Process)definitions.getRootElements().get(0);
        ObjectNode on = fixFlowConverter.convertDefinitions2Json(definitions);
        ObjectNode rootNode = objectMapper.createObjectNode();
        rootNode.put("name", process.getName());
        rootNode.put("description", process.getName());
        rootNode.put("modelId", process.getId());
        rootNode.put("model", on);
View Full Code Here

  public Definitions convertToBpmnModel(JsonNode modelNode) {
    //加载一个空的definitions
   
    String nodeTempPath = ProcessEngineManagement.getDefaultProcessEngine().getProcessEngineConfiguration().getCopyTemplatePath();
    InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(nodeTempPath);
    Definitions bpmnModel = new FixFlowConverter().getDefinitions("temp", inputStream);
    BPMNDiagram bpmnDiagram=bpmnModel.getDiagrams().get(0);
    BPMNPlane bpmnPlane = bpmnDiagram.getPlane();
    Process process = (Process)bpmnModel.getRootElements().get(0);
    Map<String, JsonNode> shapeMap = new HashMap<String, JsonNode> ();
    Map<String, JsonNode> sourceRefMap = new HashMap<String, JsonNode>();
View Full Code Here

            }else{
                    fileName = processId + ".bpmn";
            }
            String processName = request("name");
            String path = buildPath()+File.separator+fileName;
            new FixFlowConverter().createBPMNFile(path, processId, processName);
            success("创建成功","String");
        }catch(Exception ex){
                ex.printStackTrace();
                error(ex.getMessage());
        }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.bpmn.converter.FixFlowConverter

Copyright © 2018 www.massapicom. 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.