02-07-2014 12:58 AM
public String editModel(String modelID) {
// TODO Auto-generated method stub
RepositoryService repositoryService = ActivitiUtil
.getRepositoryService();
Model model = repositoryService.getModel(modelID);
//
SimpleWorkflowJsonConverter simpleWorkflowJsonConverter = new SimpleWorkflowJsonConverter();
WorkflowDefinition workflowDefinition = simpleWorkflowJsonConverter
.readWorkflowDefinition(repositoryService
.getModelEditorSource(model.getId()));
WorkflowDefinitionConversionFactory workflowDefinitionConversionFactory = new WorkflowDefinitionConversionFactory();
WorkflowDefinitionConversion conversion = workflowDefinitionConversionFactory
.createWorkflowDefinitionConversion(workflowDefinition);
conversion.convert();
model.setCategory(null);
ObjectMapper objectMapper = new ObjectMapper();
ObjectNode metaInfoJson = objectMapper.createObjectNode();
metaInfoJson.put("name", model.getName());
model.setMetaInfo(metaInfoJson.toString());
repositoryService.saveModel(model);
BpmnJsonConverter bpmnJsonConverter = new BpmnJsonConverter();
ObjectNode json = bpmnJsonConverter.convertToJson(conversion
.getBpmnModel());
try {
repositoryService.addModelEditorSource(model.getId(), json
.toString().getBytes("utf-8"));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return model.getId();
}
org.activiti.workflow.simple.exception.SimpleWorkflowException: Error while parsing JSON
at org.activiti.workflow.simple.converter.json.SimpleWorkflowJsonConverter.wrapExceptionRead(SimpleWorkflowJsonConverter.java:107)
at org.activiti.workflow.simple.converter.json.SimpleWorkflowJsonConverter.readWorkflowDefinition(SimpleWorkflowJsonConverter.java:69)02-07-2014 03:53 AM
02-07-2014 04:40 AM
02-10-2014 03:29 AM
02-11-2014 02:37 AM
02-11-2014 10:24 AM
02-11-2014 08:22 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.