public Model copy(String id) throws Exception {
Model sourceModel = this.get(id);
ObjectNode sourceObjectNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(id));
Model model = repositoryService.newModel();
model.setKey(sourceModel.getKey() + "_copy" );
model.setName(sourceModel.getName()+"_copy");
model.setCategory(sourceModel.getCategory());
model.setVersion(1);
repositoryService.saveModel(model);
ObjectNode editorNode = sourceObjectNode.deepCopy();
ObjectNode properties = objectMapper.createObjectNode();
properties.put("process_id", model.getKey());
properties.put("process_author", "yuxiangyang");
properties.put("name", model.getName());
editorNode.set("properties", properties);
repositoryService.addModelEditorSource(model.getId(), editorNode.toString().getBytes("utf-8")); return model;
}