diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index 7494ea60..3655dd59 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/io/file/CoeDesignerFile.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/io/file/CoeDesignerFile.java index 1169724b..87f36189 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/io/file/CoeDesignerFile.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/io/file/CoeDesignerFile.java @@ -197,6 +197,10 @@ public class CoeDesignerFile { if (!dir.exists()) { dir.mkdirs(); } + File subProcessPath = new File(model.getPath() + "/" + model.getMethodId().substring(model.getMethodId().indexOf(".") + 1)); + if (!subProcessPath.exists()){ + subProcessPath.mkdirs(); + } UtilFile utilFile = new UtilFile(getChildProcessPathName(childProcessId)); if (!utilFile.exists()){ try { @@ -228,7 +232,7 @@ public class CoeDesignerFile { * @return */ public String getChildProcessPathName(String childProcessId){ - return model.getPath() + childProcessId; + return model.getPath() + model.getMethodId().substring(model.getMethodId().indexOf(".") + 1) + "/" + childProcessId; } /** diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index 6d664fce..90fbf279 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -6086,6 +6086,59 @@ public class CoeProcessLevelWeb extends ActionWeb { defineModel.setUpdateTime(now); defineModel.setDefinition(define); CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// 保存文件 + + // 针对端到端的模型文件 保存时 将已展开的范围框对应子流程模型 保存到总图的同级目录下 + JSONObject elements = definition.getJSONObject("elements"); + Set scopeShapeIdSet = elements.keySet().stream().filter(key -> "scopeLimitation".equals(elements.getJSONObject(key).getString("name"))).collect(Collectors.toSet()); + if (scopeShapeIdSet.size() > 0){ // 说明有展开的节点 + for (String scopeShapeId : scopeShapeIdSet) { + // 存放范围框内部元素 + JSONArray inScopeShapeRangeEles = new JSONArray(); + // 获取当前范围框内的元素信息 + JSONObject scopeShapeProps = elements.getJSONObject(scopeShapeId).getJSONObject("props"); + double scopeX = scopeShapeProps.getDoubleValue("x"), scopeY = scopeShapeProps.getDoubleValue("y"), scopeW = scopeShapeProps.getDoubleValue("w"), scopeH = scopeShapeProps.getDoubleValue("h"); + for (String key : elements.keySet()) { + if (scopeShapeId.equals(key)) continue; // 范围框本身不算作其内部元素 + JSONObject shape = elements.getJSONObject(key); + if ("linker".equals(shape.getString("name"))){ // 连线 + JSONObject from = shape.getJSONObject("from"); + JSONObject to = shape.getJSONObject("to"); + double fromX = from.getDoubleValue("x"), fromY = from.getDoubleValue("y"), toX = to.getDoubleValue("x"), toY = to.getDoubleValue("y"); + if ((scopeX < fromX && fromX < scopeX + scopeW && scopeY < fromY && fromY < scopeY + scopeH) || (scopeX < toX && toX < scopeX + scopeW && scopeY < toY && toY < scopeY + scopeH)){ + inScopeShapeRangeEles.add(shape); + } + }else { + double x = shape.getJSONObject("props").getDoubleValue("x"); + double y = shape.getJSONObject("props").getDoubleValue("y"); + if (scopeX <= x && x < scopeX + scopeW && scopeY <= y && y < scopeY + scopeH){ + inScopeShapeRangeEles.add(shape); + } + } + } + // 获取当前范围框所对应的子流程文件信息 + if (inScopeShapeRangeEles.size() > 0){ + List relationModelList = DesignerShapeRelationCache.getListByAttrId(uuid, scopeShapeId, "child_process"); + DesignerShapeRelationModel relationModel = relationModelList.stream().findFirst().orElse(null); + if (relationModel == null) + throw new AWSException("未找到当前节点所标识的子流程文件信息"); + String relationFileId = relationModel.getRelationFileId(); + + BaseModel relationBaseModel = CoeDesignerAPIManager.getInstance().getDefinition(relationFileId, 0); + + JSONObject childProcessObj = JSONObject.parseObject(relationBaseModel.getDefinition()); + JSONObject newElements = new JSONObject(); + for (Object o : inScopeShapeRangeEles) { + JSONObject ele = (JSONObject) o; + newElements.put(ele.getString("id"), ele); + } + childProcessObj.put("elements", newElements); + + // 保存展开的子流程信息到 总图的同级目录下 + CoeDesignerAPIManager.getInstance().storeChildProcessDefine(defineModel, relationFileId, childProcessObj.toJSONString()); + + } + } + } } // 关联/被关联图形的名称更新