public OperResult appendProcessForwardModel(String process_id,Map properties){
OperResult result = new OperResult();
if(process_id==null){
result.setFailed(PROCESS_REQUIRE_ID);
}else{
Process process = processDAO.findById(process_id);
if(process==null){
result.setFailed(PROCESS_NOTEXIST,process_id);
}else{
ForwardModel forwardModel = process.getForwardModel();
ForwardModel oldModel = forwardModel;
if(forwardModel==null){
forwardModel = new ForwardModel();
}
try {
BeanUtils.populate(forwardModel, properties);
if(oldModel==null){
forwardModel.setId(MyUUIDGen.getUUID());
}else{
forwardModel.setId(oldModel.getId());
}
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(forwardModel.getAccuracy()>oldModel.getAccuracy()){
forwardModelDAO.merge(forwardModel);
if(oldModel==null){
process.setForwardModel(forwardModel);
processDAO.merge(process);
}
ProcessTemplate processTemplate = process.getProcessTemplate();
if(processTemplate!=null){
if(processTemplate.getForwardModel()==null){
processTemplate.setForwardModel(forwardModel);
processTemplateDAO.merge(processTemplate);
}