|
@ -79,6 +79,7 @@ public class ESBCamelService {
|
|
|
});
|
|
|
|
|
|
if (!created[0]) {
|
|
|
System.out.println("onServiceFlowAdd ,生成processor文件失败,");
|
|
|
return Result.error("服务流程启动失败!");
|
|
|
}
|
|
|
|
|
@ -91,6 +92,7 @@ public class ESBCamelService {
|
|
|
}
|
|
|
});
|
|
|
if (!created[0]) {
|
|
|
System.out.println("onServiceFlowAdd ,生成route文件失败,");
|
|
|
return Result.error("服务流程启动失败!");
|
|
|
}
|
|
|
} else {
|
|
@ -233,7 +235,6 @@ public class ESBCamelService {
|
|
|
if (serviceFlowValid.is()) return Result.error("必要的入参数据不正确,请检查!");
|
|
|
|
|
|
ServiceFlow serviceFlow = serviceFlowValid.getServiceFlow();
|
|
|
String routeCode = serviceFlow.getRouteCode();
|
|
|
ArrayList<ServiceFlow.HandleFile> handleFiles = serviceFlowValid.getHandleFiles();
|
|
|
|
|
|
if ("java".equals(serviceFlowValid.getServiceFlow().getFlowType())) {
|
|
@ -249,7 +250,10 @@ public class ESBCamelService {
|
|
|
});
|
|
|
|
|
|
if (!created[0]) {
|
|
|
System.out.println("processor 生成失败!");
|
|
|
return Result.error("服务流程启动失败!");
|
|
|
}else {
|
|
|
System.out.println("processor 生成成功!");
|
|
|
}
|
|
|
|
|
|
handleFiles.stream().filter(handleFile -> ServiceFlowConstant.FLOW_TYPE_ROUTE.equals(handleFile.getUsage())).forEach(handleFile -> {
|
|
@ -261,7 +265,10 @@ public class ESBCamelService {
|
|
|
}
|
|
|
});
|
|
|
if (!created[0]) {
|
|
|
System.out.println("route文件 生成失败!");
|
|
|
return Result.error("服务流程启动失败!");
|
|
|
}else {
|
|
|
System.out.println("route文件 生成成功!");
|
|
|
}
|
|
|
} else {
|
|
|
for (ServiceFlow.HandleFile handleFile : handleFiles) {
|
|
@ -325,6 +332,7 @@ public class ESBCamelService {
|
|
|
|
|
|
private boolean generateClassFile(ServiceFlow.HandleFile handleFile) throws Exception {
|
|
|
if (handleFile == null) {
|
|
|
System.out.println("=====handleFile is null...");
|
|
|
return false;
|
|
|
}
|
|
|
SystemCamelContext.putClassMapping(handleFile.getRouteCode(), handleFile.getPackageName(), handleFile.getUsage(), handleFile.getClassName());
|
|
@ -335,6 +343,7 @@ public class ESBCamelService {
|
|
|
String sourcePath = ClassFileUtil.downFile(downUrl, resource, handleFile.getPackageName(), handleFile.getClassName(), ClassFileUtil.JAVA_FILE);
|
|
|
|
|
|
if (sourcePath == null) {
|
|
|
System.out.println("下载java文件失败,downUrl:"+downUrl);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@ -349,6 +358,8 @@ public class ESBCamelService {
|
|
|
String fileName = handleFile.getClassName() + ClassFileUtil.CLASS_FILE;
|
|
|
String uploadUrl = fsUrl + "/" + handleFile.getFilePath();
|
|
|
ClassFileUtil.uploadFile(uploadUrl, new File(classPath), fileName);
|
|
|
}else {
|
|
|
System.out.println("编译失败,sourcePath:"+sourcePath);
|
|
|
}
|
|
|
return succ;
|
|
|
}
|