解决导入xml报错问题,bug no 4436
This commit is contained in:
parent
6da183ea67
commit
c067e1e1b2
Binary file not shown.
@ -347,11 +347,20 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
printMsg("流程模型" + palModel.getName() + "无任何角色模型,忽略角色与岗位导入");
|
||||
return null;
|
||||
}
|
||||
|
||||
Set<String> noneRelationRole = new HashSet<>();
|
||||
|
||||
// 创建角色与形状关联关系
|
||||
// 获取当前aris模型内的所有角色list
|
||||
List<CxnOccModel> roleCxnOccModels = new ArrayList<>();
|
||||
for (ObjOccModel roleOccModel : roleObjOccModels) {
|
||||
List<CxnOccModel> list = cxnOccMap.get(roleOccModel.getId());
|
||||
// list为null,该角色在该模型中没有连接任何的活动,忽略导入该角色
|
||||
if (list == null) {
|
||||
printMsg("流程模型" + palModel.getName() + "检测到角色" + objDefMap.get(roleOccModel.getDefId()).getName() + "尚未连接到任何活动上,忽略该角色");
|
||||
noneRelationRole.add(objDefMap.get(roleOccModel.getDefId()).getName());
|
||||
continue;
|
||||
}
|
||||
for (CxnOccModel cxnOccModel : list) {
|
||||
if (cxnOccModel.getModelId().equals(arisModel.getId())) {
|
||||
roleCxnOccModels.add(cxnOccModel);
|
||||
@ -378,6 +387,12 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
}
|
||||
repeatRoleMap.get(roleName).add(occModel.getId());
|
||||
}
|
||||
// 没有关联活动的角色,也加入到角色图中
|
||||
for (String roleName : noneRelationRole) {
|
||||
if (!repeatRoleMap.containsKey(roleName)) {
|
||||
repeatRoleMap.put(roleName, new HashSet<>());
|
||||
}
|
||||
}
|
||||
|
||||
// 创建角色图的名称与PAL角色图形状ID对应关系
|
||||
Map<String, String> roleNamePalIdMap = new HashMap<>();
|
||||
@ -1281,6 +1296,15 @@ public class DataMigrationWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
|
||||
// 删除没有与活动进行连线相连的角色形状(角色图中已包含该角色图标)
|
||||
for (String key : elements.keySet()) {
|
||||
JSONObject tempShapeObj = elements.getJSONObject(key);
|
||||
if ("role".equals(tempShapeObj.getString("name")) && !removeKey.contains(tempShapeObj.getString("id"))) {
|
||||
removeKey.add(key);
|
||||
printMsg("流程" + arisModel.getName() + "删除角色形状" + tempShapeObj.getString("text") + ",该角色无连线连接到活动");
|
||||
}
|
||||
}
|
||||
|
||||
// 保存关联关系
|
||||
if (relationList.size() > 0) {
|
||||
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user