| | |
| | | Model modelData = repositoryService.getModel(workflowModelDto.getModelId()); |
| | | byte[] bpmnBytes = null; |
| | | bpmnBytes = repositoryService.getModelEditorSource(workflowModelDto.getModelId()); |
| | | String encoded = Base64Convert.byteToBase64(bpmnBytes); |
| | | byte[] decoded = Base64Convert.base64ToByte(encoded); |
| | | String xml = new String(decoded); |
| | | String processName = modelData.getName() + ".bpmn20.xml"; |
| | | ByteArrayInputStream in = new ByteArrayInputStream(bpmnBytes); |
| | | Deployment deployment = repositoryService.createDeployment().name(oaWorkflowDtos.get(0).getFlowName()) |
| | |
| | | sql.append("store_id varchar(30) not null COMMENT '商户ID',"); |
| | | sql.append("create_user_id varchar(30) not null COMMENT '创建人ID',"); |
| | | sql.append("create_user_name varchar(64) not null COMMENT '创建人',"); |
| | | sql.append("file varchar(512) COMMENT '附件地址',"); |
| | | sql.append("state varchar(12) not null COMMENT '状态 1001 申请 1002 待审核 1003 退回 1004 委托 1005 办结',"); |
| | | sql.append("create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',"); |
| | | sql.append("status_cd varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'"); |
| | |
| | | model.setName(oaWorkflowDtos.get(0).getFlowName()); |
| | | model.setKey("java110_" + oaWorkflowDtos.get(0).getFlowId()); |
| | | repositoryService.saveModel(model); |
| | | repositoryService.addModelEditorSource(model.getId(), workflowModelDto.getJson_xml().getBytes("utf-8")); |
| | | String jsonXml = workflowModelDto.getJson_xml(); |
| | | jsonXml = jsonXml.replaceAll("camunda:assignee", "activiti:assignee"); |
| | | repositoryService.addModelEditorSource(model.getId(), jsonXml.getBytes("utf-8")); |
| | | |
| | | InputStream svgStream = new ByteArrayInputStream(workflowModelDto.getSvg_xml().getBytes("utf-8")); |
| | | TranscoderInput input = new TranscoderInput(svgStream); |
| | |
| | | for (Element userTask : userTasks) { |
| | | Attribute assignee = userTask.attribute("assignee"); |
| | | if (assignee == null) { |
| | | userTask.addAttribute("activiti:assignee", "${nextUserId}"); |
| | | userTask.addAttribute("camunda:assignee", "${nextUserId}"); |
| | | } |
| | | } |
| | | |
| | | Attribute activiti = rootElement.attribute("activiti"); |
| | | if (activiti == null) { |
| | | rootElement.addAttribute("xmlns:activiti", "http://activiti.org/bpmn"); |
| | | } |
| | | |
| | | Attribute processId = process.attribute("id"); |
| | |
| | | String processIdValue = processId.getValue(); |
| | | String newXml = rootElement.asXML(); |
| | | newXml = newXml.replaceAll(processIdValue, "java110_" + workflowModelDto.getFlowId()); |
| | | |
| | | |
| | | workflowModelDto.setJson_xml(newXml); |
| | | } |
| | | |
| | |
| | | |
| | | Element rootElement = doc.getRootElement(); |
| | | Element process = rootElement.element("process"); |
| | | List<Element> userTasks = process.elements("userTask1"); |
| | | List<Element> userTasks = process.elements("userTask"); |
| | | for (Element userTask : userTasks) { |
| | | Attribute assignee = userTask.attribute("assignee"); |
| | | if (assignee == null) { |
| | | userTask.addAttribute("camunda:assignee", "${createUserId}"); |
| | | userTask.addAttribute("activiti:assignee", "${createUserId}"); |
| | | } |
| | | } |
| | | Attribute activiti = rootElement.attribute("activiti"); |
| | | if (activiti == null) { |
| | | rootElement.addAttribute("xmlns:activiti", "http://activiti.org/bpmn"); |
| | | } |
| | | |
| | | Attribute processId = process.attribute("id"); |
| | | if (processId == null) { |