diff --git a/com.actionsoft.apps.coe.pal.datamigration/lib/com.actionsoft.apps.coe.pal.datamigration.jar b/com.actionsoft.apps.coe.pal.datamigration/lib/com.actionsoft.apps.coe.pal.datamigration.jar index b029ebda..c7c33741 100644 Binary files a/com.actionsoft.apps.coe.pal.datamigration/lib/com.actionsoft.apps.coe.pal.datamigration.jar and b/com.actionsoft.apps.coe.pal.datamigration/lib/com.actionsoft.apps.coe.pal.datamigration.jar differ diff --git a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/web/DataMigrationWeb.java b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/web/DataMigrationWeb.java index cb416065..788dc328 100644 --- a/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/web/DataMigrationWeb.java +++ b/com.actionsoft.apps.coe.pal.datamigration/src/com/actionsoft/apps/coe/pal/datamigration/web/DataMigrationWeb.java @@ -347,11 +347,20 @@ public class DataMigrationWeb extends ActionWeb { printMsg("流程模型" + palModel.getName() + "无任何角色模型,忽略角色与岗位导入"); return null; } + + Set noneRelationRole = new HashSet<>(); + // 创建角色与形状关联关系 // 获取当前aris模型内的所有角色list List roleCxnOccModels = new ArrayList<>(); for (ObjOccModel roleOccModel : roleObjOccModels) { List 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 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();