コード例 #1
0
 @SuppressWarnings("unchecked")
 @Override
 public String inportFlowbase(String flowBaseXml) {
   ByteArrayInputStream bais;
   try {
     bais = new ByteArrayInputStream(flowBaseXml.getBytes("UTF-8"));
     SAXBuilder saxBuilder = new SAXBuilder();
     Document doc = saxBuilder.build(bais);
     Element root = doc.getRootElement();
     Flowbase flowbase = XmlUtil.getBeanByElement(root, Flowbase.class);
     flowbase.setFlowName(flowbase.getFlowName() + "-副本");
     this.flowbaseDao.save(flowbase);
     List<Element> nodeList = root.getChildren("flownode");
     this.flownodeService.importFlowNode(flowbase.getId(), nodeList);
     // TODO 未完成
     return flowbase.getId();
   } catch (UnsupportedEncodingException e) {
     log.error(
         this.getClass().getSimpleName() + " e==> inportFlowbase,UnsupportedEncodingException", e);
     throw new BpmException("bpm003", "导入流程失败");
   } catch (JDOMException e) {
     log.error(this.getClass().getSimpleName() + " e==> inportFlowbase,JDOMException", e);
     throw new BpmException("bpm003", "导入流程失败");
   } catch (IOException e) {
     log.error(this.getClass().getSimpleName() + " e==> inportFlowbase,IOException", e);
     throw new BpmException("bpm003", "导入流程失败");
   }
 }