|
@ -345,7 +345,9 @@ public class FlowManager implements IFlowManage {
|
|
|
|
|
|
|
|
|
//新增processor记录
|
|
|
int sum = 0;
|
|
|
for (SystemServiceFlowTemp process:flowClassProces){
|
|
|
|
|
|
// String newProcessName = process.getClassName()+timestamp;
|
|
|
String newProcessPath = null;
|
|
|
StringBuilder proPath = new StringBuilder( );;
|
|
@ -369,54 +371,63 @@ public class FlowManager implements IFlowManage {
|
|
|
boolean succ = (boolean) body.get("successFlg");
|
|
|
if (succ){
|
|
|
newProcessPath = body.get("message").toString();
|
|
|
System.out.println(response.getBody());
|
|
|
SystemServiceFlowClass processClass = new SystemServiceFlowClass();
|
|
|
processClass.setPackageName(process.getPackageName());
|
|
|
processClass.setClassName(process.getClassName());
|
|
|
processClass.setClassPath(newProcessPath);
|
|
|
processClass.setFlowId(newFlow.getId());
|
|
|
processClass.setType(Constants.FLOW_TYPE_PROCESSOR);
|
|
|
flowClassDao.saveEntity(processClass);
|
|
|
processClass.setIsUpdate("1");
|
|
|
sendUpdateMessage(newFlow.getCode(), processClass, Constants.FLOW_OP_ADD);
|
|
|
sum++;
|
|
|
// copyProcessor(process.getClassPath(),proPath.toString(),process.getClassName());
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
System.out.println(response.getBody());
|
|
|
SystemServiceFlowClass processClass = new SystemServiceFlowClass();
|
|
|
processClass.setPackageName(process.getPackageName());
|
|
|
processClass.setClassName(process.getClassName());
|
|
|
processClass.setClassPath(newProcessPath);
|
|
|
processClass.setFlowId(newFlow.getId());
|
|
|
processClass.setType(Constants.FLOW_TYPE_PROCESSOR);
|
|
|
flowClassDao.saveEntity(processClass);
|
|
|
processClass.setIsUpdate("1");
|
|
|
sendUpdateMessage(newFlow.getCode(), processClass, Constants.FLOW_OP_ADD);
|
|
|
|
|
|
// copyProcessor(process.getClassPath(),proPath.toString(),process.getClassName());
|
|
|
}
|
|
|
|
|
|
String newClassName = flowTemp.getClassName()+timestamp;
|
|
|
String newRoutePath =null;
|
|
|
params = new HashMap<>();
|
|
|
params.put("type",Constants.FLOW_TYPE_ROUTE);
|
|
|
params.put("filePath", flowTemp.getClassPath());
|
|
|
params.put("packageName", basePath.toString());
|
|
|
params.put("oldClassName", flowTemp.getClassName());
|
|
|
params.put("newClassName",newClassName);//原文件名加当前时间戳
|
|
|
params.put("newCron",newCron);
|
|
|
HTTPResponse response = HttpClientKit.post(genCamelUrl, params);
|
|
|
if (response.getStatusCode()==200 ){
|
|
|
Map<String,Object> body = objectMapper.readValue(response.getBody(),Map.class);
|
|
|
boolean succ = (boolean) body.get("successFlg");
|
|
|
if (succ){
|
|
|
newRoutePath = body.get("message").toString();
|
|
|
if (sum == flowClassProces.size()){
|
|
|
String newClassName = flowTemp.getClassName()+timestamp;
|
|
|
String newRoutePath =null;
|
|
|
params = new HashMap<>();
|
|
|
params.put("type",Constants.FLOW_TYPE_ROUTE);
|
|
|
params.put("filePath", flowTemp.getClassPath());
|
|
|
params.put("packageName", basePath.toString());
|
|
|
params.put("oldClassName", flowTemp.getClassName());
|
|
|
params.put("newClassName",newClassName);//原文件名加当前时间戳
|
|
|
params.put("newCron",newCron);
|
|
|
HTTPResponse response = HttpClientKit.post(genCamelUrl, params);
|
|
|
if (response.getStatusCode()==200 ){
|
|
|
Map<String,Object> body = objectMapper.readValue(response.getBody(),Map.class);
|
|
|
boolean succ = (boolean) body.get("successFlg");
|
|
|
if (succ){
|
|
|
newRoutePath = body.get("message").toString();
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
System.out.println(response.getBody());
|
|
|
SystemServiceFlowClass newFlowClass = new SystemServiceFlowClass();
|
|
|
newFlowClass.setPackageName(flowTemp.getPackageName());
|
|
|
newFlowClass.setClassName(newClassName);
|
|
|
newFlowClass.setClassPath(newRoutePath);
|
|
|
newFlowClass.setFlowId(newFlow.getId());
|
|
|
newFlowClass.setType(Constants.FLOW_TYPE_ROUTE);
|
|
|
flowClassDao.saveEntity(newFlowClass);
|
|
|
newFlowClass.setIsUpdate("1");
|
|
|
sendUpdateMessage(newFlow.getCode(), newFlowClass, Constants.FLOW_OP_ADD);
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
System.out.println("生成processoer过程失败");
|
|
|
return null;
|
|
|
}
|
|
|
System.out.println(response.getBody());
|
|
|
|
|
|
SystemServiceFlowClass newFlowClass = new SystemServiceFlowClass();
|
|
|
newFlowClass.setPackageName(flowTemp.getPackageName());
|
|
|
newFlowClass.setClassName(newClassName);
|
|
|
newFlowClass.setClassPath(newRoutePath);
|
|
|
newFlowClass.setFlowId(newFlow.getId());
|
|
|
newFlowClass.setType(Constants.FLOW_TYPE_ROUTE);
|
|
|
flowClassDao.saveEntity(newFlowClass);
|
|
|
newFlowClass.setIsUpdate("1");
|
|
|
sendUpdateMessage(newFlow.getCode(), newFlowClass, Constants.FLOW_OP_ADD);
|
|
|
|
|
|
// genNewRoutefile(flowTemp.getClassPath(),basePath.toString(),flowTemp.getClassName(),newClassName,newCron);
|
|
|
return newFlow.getId();
|