activitie中文乱码

Activiti Model部署的中文乱码

1.Model部署xml文件中的中文乱码

    /**
     * 根据Model部署流程
     */
    @RequestMapping(value = "deploy/{modelId}")
    public String deploy(@PathVariable("modelId") String modelId, RedirectAttributes redirectAttributes) {
        try {
            Model modelData = repositoryService.getModel(modelId);
            ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
            byte[] bpmnBytes = null;

            BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);
            bpmnBytes = new BpmnXMLConverter().convertToXML(model);

            String processName = modelData.getName() + ".bpmn20.xml";
       
            Deployment deployment = repositoryService.createDeployment().name(modelData.getName()).addString(processName, new String(bpmnBytes,"UTF-8")).deploy();
            redirectAttributes.addFlashAttribute("message", "部署成功,部署ID=" + deployment.getId());
        } catch (Exception e) {
            logger.error("根据模型部署流程失败:modelId={}", modelId, e);
        }
        return "redirect:/workflow/model/list.do";
    }
说明:就是在bpmnBytes中加入UTF-8


2.部署的图片有中文乱码 ,解决方法

	
		
		
		
		
		
		  
        
		
		
	

说明:就是在上面文件中加入
	  
        


你可能感兴趣的:(Activiti在线编辑器)