|
@@ -436,7 +436,8 @@ public class FlowService extends BaseTransaction {
|
|
|
|
|
|
|
|
String alignProcessNameWithReleasedVersion(GeneralDBAccess baseGdba, Long mkid, BpmLc bigBpmLc, BpmLc bpmLc, BpmLctfbjl currentRelease, String jpdlXmlContent) throws Exception {
|
|
String alignProcessNameWithReleasedVersion(GeneralDBAccess baseGdba, Long mkid, BpmLc bigBpmLc, BpmLc bpmLc, BpmLctfbjl currentRelease, String jpdlXmlContent) throws Exception {
|
|
|
Long beforeBbh = currentRelease != null ? currentRelease.getBbh() : null;
|
|
Long beforeBbh = currentRelease != null ? currentRelease.getBbh() : null;
|
|
|
- String targetProcessName = getReleasedProcessName(baseGdba, mkid, bpmLc.getLcid(), beforeBbh);
|
|
|
|
|
|
|
+ String targetProcessKey = extractProcessKey(jpdlXmlContent);
|
|
|
|
|
+ String targetProcessName = getReleasedProcessName(baseGdba, mkid, bpmLc.getLcid(), beforeBbh, targetProcessKey);
|
|
|
if (StringUtil.isNull(targetProcessName)) {
|
|
if (StringUtil.isNull(targetProcessName)) {
|
|
|
Long lclbid = StringUtil.notNull(bigBpmLc.getLclbid()) ? bigBpmLc.getLclbid() : bpmLc.getLclbid();
|
|
Long lclbid = StringUtil.notNull(bigBpmLc.getLclbid()) ? bigBpmLc.getLclbid() : bpmLc.getLclbid();
|
|
|
targetProcessName = mkid + "-" + lclbid + "-" + bpmLc.getMc();
|
|
targetProcessName = mkid + "-" + lclbid + "-" + bpmLc.getMc();
|
|
@@ -450,7 +451,7 @@ public class FlowService extends BaseTransaction {
|
|
|
"$1" + Matcher.quoteReplacement(targetProcessName) + "$2");
|
|
"$1" + Matcher.quoteReplacement(targetProcessName) + "$2");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String getReleasedProcessName(GeneralDBAccess baseGdba, Long mkid, Long lcid, Long beforeBbh) throws Exception {
|
|
|
|
|
|
|
+ String getReleasedProcessName(GeneralDBAccess baseGdba, Long mkid, Long lcid, Long beforeBbh, String expectedProcessKey) throws Exception {
|
|
|
String releasedJpdlPath = getLatestReleasedJpdlPath(baseGdba, mkid, lcid, beforeBbh);
|
|
String releasedJpdlPath = getLatestReleasedJpdlPath(baseGdba, mkid, lcid, beforeBbh);
|
|
|
if (StringUtil.isNull(releasedJpdlPath)) {
|
|
if (StringUtil.isNull(releasedJpdlPath)) {
|
|
|
return null;
|
|
return null;
|
|
@@ -461,7 +462,12 @@ public class FlowService extends BaseTransaction {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String processName = extractProcessName(FileUtil.readFile(resolvedPath));
|
|
|
|
|
|
|
+ String releasedJpdlXml = FileUtil.readFile(resolvedPath);
|
|
|
|
|
+ String releasedProcessKey = extractProcessKey(releasedJpdlXml);
|
|
|
|
|
+ if (StringUtil.notNull(expectedProcessKey) && !expectedProcessKey.equals(releasedProcessKey)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ String processName = extractProcessName(releasedJpdlXml);
|
|
|
if (StringUtil.isNull(processName) || looksMojibakeProcessName(processName)) {
|
|
if (StringUtil.isNull(processName) || looksMojibakeProcessName(processName)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -508,6 +514,15 @@ public class FlowService extends BaseTransaction {
|
|
|
return matcher.find() ? matcher.group(1) : null;
|
|
return matcher.find() ? matcher.group(1) : null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ String extractProcessKey(String jpdlXmlContent) {
|
|
|
|
|
+ if (StringUtil.isNull(jpdlXmlContent)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ java.util.regex.Matcher matcher = Pattern.compile("<process\\s+[^>]*key=\"([^\"]+)\"").matcher(jpdlXmlContent);
|
|
|
|
|
+ return matcher.find() ? matcher.group(1) : null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
boolean looksMojibakeProcessName(String processName) {
|
|
boolean looksMojibakeProcessName(String processName) {
|
|
|
return processName.indexOf("æ") >= 0
|
|
return processName.indexOf("æ") >= 0
|
|
|
|| processName.indexOf("Ã") >= 0
|
|
|| processName.indexOf("Ã") >= 0
|