|
|
@@ -427,15 +427,16 @@ public class FlowService extends BaseTransaction {
|
|
|
// 因此这里在生成发布版 jpdl 前,先将结束节点的消息配置剔除,保持与当前线上可运行的历史流程结构一致。
|
|
|
stripUnsupportedEndNodeMessageConfig(nodeReferDataList);
|
|
|
String jpdlXmlContent = JpdlXmlUtil.createJpdlXmlContent(mk, FileUtil.readFile(jsonFilePath), nodeReferDataList, bpmLc.getLcid(), bigBpmLc.getMc(), bigBpmLc.getKey());
|
|
|
- jpdlXmlContent = alignProcessNameWithReleasedVersion(getGdbaInstance(DBNameVars.BASE), mk.getMkid(), bigBpmLc, bpmLc, jpdlXmlContent);
|
|
|
+ jpdlXmlContent = alignProcessNameWithReleasedVersion(getGdbaInstance(DBNameVars.BASE), mk.getMkid(), bigBpmLc, bpmLc, bpmLctfbjl, jpdlXmlContent);
|
|
|
|
|
|
FileUtil.writeFile(jpdlXmlContent, getWebRootPath() + bpmLctfbjl.getJpdlWjlj());
|
|
|
FileUtil.copyFile(jsonFilePath, getWebRootPath() + bpmLctfbjl.getJsonWjlj());
|
|
|
|
|
|
}
|
|
|
|
|
|
- String alignProcessNameWithReleasedVersion(GeneralDBAccess baseGdba, Long mkid, BpmLc bigBpmLc, BpmLc bpmLc, String jpdlXmlContent) throws Exception {
|
|
|
- String targetProcessName = getReleasedProcessName(baseGdba, mkid, bpmLc.getLcid());
|
|
|
+ String alignProcessNameWithReleasedVersion(GeneralDBAccess baseGdba, Long mkid, BpmLc bigBpmLc, BpmLc bpmLc, BpmLctfbjl currentRelease, String jpdlXmlContent) throws Exception {
|
|
|
+ Long beforeBbh = currentRelease != null ? currentRelease.getBbh() : null;
|
|
|
+ String targetProcessName = getReleasedProcessName(baseGdba, mkid, bpmLc.getLcid(), beforeBbh);
|
|
|
if (StringUtil.isNull(targetProcessName)) {
|
|
|
Long lclbid = StringUtil.notNull(bigBpmLc.getLclbid()) ? bigBpmLc.getLclbid() : bpmLc.getLclbid();
|
|
|
targetProcessName = mkid + "-" + lclbid + "-" + bpmLc.getMc();
|
|
|
@@ -449,8 +450,8 @@ public class FlowService extends BaseTransaction {
|
|
|
"$1" + Matcher.quoteReplacement(targetProcessName) + "$2");
|
|
|
}
|
|
|
|
|
|
- String getReleasedProcessName(GeneralDBAccess baseGdba, Long mkid, Long lcid) throws Exception {
|
|
|
- String releasedJpdlPath = getLatestReleasedJpdlPath(baseGdba, mkid, lcid);
|
|
|
+ String getReleasedProcessName(GeneralDBAccess baseGdba, Long mkid, Long lcid, Long beforeBbh) throws Exception {
|
|
|
+ String releasedJpdlPath = getLatestReleasedJpdlPath(baseGdba, mkid, lcid, beforeBbh);
|
|
|
if (StringUtil.isNull(releasedJpdlPath)) {
|
|
|
return null;
|
|
|
}
|
|
|
@@ -461,14 +462,24 @@ public class FlowService extends BaseTransaction {
|
|
|
}
|
|
|
|
|
|
String processName = extractProcessName(FileUtil.readFile(resolvedPath));
|
|
|
- return StringUtil.notNull(processName) ? processName : null;
|
|
|
+ if (StringUtil.isNull(processName) || looksMojibakeProcessName(processName)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return processName;
|
|
|
}
|
|
|
|
|
|
- String getLatestReleasedJpdlPath(GeneralDBAccess baseGdba, Long mkid, Long lcid) throws Exception {
|
|
|
- String sql = "select fbjl.jpdl_wjlj from bpm_lctfbjl fbjl where fbjl.mkid = :mkid and fbjl.lcid = :lcid order by fbjl.bbh desc limit 1 ";
|
|
|
+ String getLatestReleasedJpdlPath(GeneralDBAccess baseGdba, Long mkid, Long lcid, Long beforeBbh) throws Exception {
|
|
|
+ String sql = "select fbjl.jpdl_wjlj from bpm_lctfbjl fbjl where fbjl.mkid = :mkid and fbjl.lcid = :lcid ";
|
|
|
+ if (StringUtil.notNull(beforeBbh)) {
|
|
|
+ sql += "and fbjl.bbh < :beforeBbh ";
|
|
|
+ }
|
|
|
+ sql += "order by fbjl.bbh desc limit 1 ";
|
|
|
SqlCommandImpl sqlCmd = new SqlCommandImpl(sql);
|
|
|
sqlCmd.setInt("mkid", mkid);
|
|
|
sqlCmd.setInt("lcid", lcid);
|
|
|
+ if (StringUtil.notNull(beforeBbh)) {
|
|
|
+ sqlCmd.setInt("beforeBbh", beforeBbh);
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> releaseMap = baseGdba.selectAsMap(sqlCmd);
|
|
|
if (StringUtil.isNull(releaseMap)) {
|
|
|
@@ -488,6 +499,13 @@ public class FlowService extends BaseTransaction {
|
|
|
return matcher.find() ? matcher.group(1) : null;
|
|
|
}
|
|
|
|
|
|
+ boolean looksMojibakeProcessName(String processName) {
|
|
|
+ return processName.indexOf("æ") >= 0
|
|
|
+ || processName.indexOf("Ã") >= 0
|
|
|
+ || processName.indexOf("Â") >= 0
|
|
|
+ || processName.indexOf("�") >= 0;
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressWarnings("unchecked")
|
|
|
void stripUnsupportedEndNodeMessageConfig(List<Map<String, List<Map<String, Object>>>> nodeReferDataList) {
|
|
|
if (StringUtil.isNull(nodeReferDataList) || nodeReferDataList.isEmpty()) {
|