diff --git a/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar b/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar index ddbb6ffb..7d9c5ecc 100644 Binary files a/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar and b/com.actionsoft.apps.coe.method.process.subprocess/lib/com.actionsoft.apps.coe.method.process.subprocess.jar differ diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java index d3714506..554cf12b 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/SubProcessController.java @@ -137,9 +137,9 @@ public class SubProcessController { * @return define */ @Mapping("com.actionsoft.apps.coe.method.process.subprocess.shape_expand") - public String shapeExpand(UserContext uc, String repositoryId, String shapeId){ + public String shapeExpand(UserContext uc, String repositoryId, String shapeId, String endToEndProcessDefineStr){ SubProcessWeb processWeb = new SubProcessWeb(uc); - return processWeb.shapeNodeExpand(repositoryId, shapeId); + return processWeb.shapeNodeExpand(repositoryId, shapeId, endToEndProcessDefineStr); } /** diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphAdjMatrix.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphAdjMatrix.java index 9a408706..c6498620 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphAdjMatrix.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphAdjMatrix.java @@ -1,5 +1,6 @@ package com.actionsoft.apps.coe.method.process.subprocess.graph; +import com.actionsoft.apps.coe.method.process.subprocess.graph.component.AbstractAdjMatrix; import com.actionsoft.apps.coe.method.process.subprocess.mode.Node; import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel; import com.actionsoft.bpms.util.ConsolePrinter; @@ -13,9 +14,8 @@ import java.util.Map; * @author oYang * @create 2023-05-11 17:10 */ -public class GraphAdjMatrix { +public class GraphAdjMatrix extends AbstractAdjMatrix { - private int[][] adjMatrix; // 邻接矩阵 private List vertexList; // 存储节点 /** @@ -23,45 +23,10 @@ public class GraphAdjMatrix { * @param nodeList */ public GraphAdjMatrix(List nodeList) { - adjMatrix = new int[nodeList.size()][nodeList.size()]; + super(nodeList.size()); vertexList = nodeList; } - /** - * 添加一条从顶点 u 到顶点 v 的有向边。 - */ - public void addEdge(int u, int v) { - adjMatrix[u][v] = 1; // 设置邻接矩阵中相应的位置为 1 - } - - /** - * 获取从顶点 u 出发可以到达的所有顶点。 - */ - public List getNeighbors(int u) { - List neighbors = new ArrayList<>(); - for (int i = 0; i < vertexList.size(); i++) { - if (adjMatrix[u][i] == 1) { - neighbors.add(i); - } - } - return neighbors; - } - - /** - * 判断从顶点 u 是否可以到达顶点 v。 - */ - public boolean hasEdge(int u, int v) { - return adjMatrix[u][v] == 1; - } - - /** - * 获取邻接矩阵 - * @return - */ - public int[][] getAdjMatrix(){ - return adjMatrix; - } - /** * 构建邻接矩阵 */ @@ -90,7 +55,7 @@ public class GraphAdjMatrix { StringBuffer sb = new StringBuffer(); for (int i = 0; i < vertexList.size(); i++) { for (int j = 0; j < vertexList.size(); j++) { - sb.append(adjMatrix[i][j]).append(" "); + sb.append(getAdjMatrix()[i][j]).append(" "); } sb.append("\n"); } diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLinkerRender.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLinkerRender.java index c1e5b7d0..02d01d10 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLinkerRender.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphLinkerRender.java @@ -48,7 +48,7 @@ public class GraphLinkerRender { double[][] turnPoi = "horizontal".equals(direction) ? calculationLinkerPointInHorizLayOut(fromPoi, toPoi) : calculationLinkerPointInVertLayOut(fromPoi, toPoi); - double[] angleArr = calculationLinkerAngle(fromPoi, toPoi, turnPoi[1], turnPoi[turnPoi.length - 2]); + double[] angleArr = calculationLinkerAngle(turnPoi[0], turnPoi[turnPoi.length - 1], turnPoi[1], turnPoi[turnPoi.length - 2]); // 构建连线 JSONObject linkerObj = JSONObject.parseObject(LinkerDefConstant.linker); linkerObj.put("id", UUIDGener.getObjectId()); diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java index fae7e555..2d3b237c 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeCloseHandle.java @@ -2,6 +2,7 @@ package com.actionsoft.apps.coe.method.process.subprocess.graph; import com.actionsoft.apps.coe.method.process.subprocess.constant.LinkerDefConstant; import com.actionsoft.apps.coe.method.process.subprocess.constant.SubProcessConst; +import com.actionsoft.apps.coe.method.process.subprocess.graph.component.AbstractAdjMatrix; import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel; @@ -252,53 +253,17 @@ public class GraphNodeCloseHandle { /** * 节点展开的邻接矩阵 */ -class NodeCloseAdjMatrix{ +class NodeCloseAdjMatrix extends AbstractAdjMatrix { - private int[][] adjMatrix; private List nodeIds; private List linkerList; public NodeCloseAdjMatrix(List nodeIds, List linkerList) { - this.adjMatrix = new int[nodeIds.size()][nodeIds.size()]; + super(nodeIds.size()); this.nodeIds = nodeIds; this.linkerList = linkerList; } - /** - * 添加一条从顶点 u 到顶点 v 的有向边。 - */ - public void addEdge(int u, int v) { - adjMatrix[u][v] = 1; // 设置邻接矩阵中相应的位置为 1 - } - - /** - * 获取从顶点 u 出发可以到达的所有顶点。 - */ - public List getNeighbors(int u) { - List neighbors = new ArrayList<>(); - for (int i = 0; i < nodeIds.size(); i++) { - if (adjMatrix[u][i] == 1) { - neighbors.add(i); - } - } - return neighbors; - } - - /** - * 判断从顶点 u 是否可以到达顶点 v。 - */ - public boolean hasEdge(int u, int v) { - return adjMatrix[u][v] == 1; - } - - /** - * 获取邻接矩阵 - * @return - */ - public int[][] getAdjMatrix(){ - return adjMatrix; - } - public List getNodeIds() { return nodeIds; } @@ -320,18 +285,6 @@ class NodeCloseAdjMatrix{ } } - // 输出邻接矩阵 - public void printAdjMatrix() { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < nodeIds.size(); i++) { - for (int j = 0; j < nodeIds.size(); j++) { - sb.append(adjMatrix[i][j]).append(" "); - } - sb.append("\n"); - } - System.out.println(sb.toString()); - } - /** * 获取总图中节点展开前的所有节点坐标 * @param elements @@ -394,7 +347,7 @@ class NodeCloseLinkerRender{ double[][] turnPoi = "horizontal".equals(direction) ? calculationLinkerPointInHorizLayOut(fromPoi, toPoi, currentExpandNodeIsStart, currentExpandNodeIsEnd) : calculationLinkerPointInVertLayOut(fromPoi, toPoi, currentExpandNodeIsStart, currentExpandNodeIsEnd); - double[] angleArr = calculationLinkerAngle(fromPoi, toPoi, turnPoi[1], turnPoi[turnPoi.length - 2]); + double[] angleArr = calculationLinkerAngle(turnPoi[0], turnPoi[turnPoi.length - 1], turnPoi[1], turnPoi[turnPoi.length - 2]); // 构建连线 JSONObject linkerObj = JSONObject.parseObject(LinkerDefConstant.linker); linkerObj.put("id", UUIDGener.getObjectId()); diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java index bc26158d..70739396 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/GraphNodeExpandHandle.java @@ -2,6 +2,7 @@ package com.actionsoft.apps.coe.method.process.subprocess.graph; import com.actionsoft.apps.coe.method.process.subprocess.constant.LinkerDefConstant; import com.actionsoft.apps.coe.method.process.subprocess.constant.SubProcessConst; +import com.actionsoft.apps.coe.method.process.subprocess.graph.component.AbstractAdjMatrix; import com.actionsoft.apps.coe.method.process.subprocess.mode.Node; import com.actionsoft.apps.coe.pal.pal.repository.designer.manage.CoeDesignerAPIManager; import com.actionsoft.apps.coe.pal.pal.repository.designer.model.BaseModel; @@ -36,7 +37,7 @@ public class GraphNodeExpandHandle { private final ReentrantLock lock = new ReentrantLock(); - public GraphNodeExpandHandle(String repositoryId, String shapeId) throws AWSException{ + public GraphNodeExpandHandle(String repositoryId, String shapeId, String endToEndProcessDefineStr) throws AWSException{ this.repositoryId = repositoryId; this.shapeId = shapeId; @@ -44,9 +45,9 @@ public class GraphNodeExpandHandle { try { readChildProcessDefine(); - readCurrentProcessDefine(); + readCurrentProcessDefine(endToEndProcessDefineStr); toAssembleScopeLimitationShape(); - } catch (AWSException e) { + } catch (Exception e) { throw new AWSException(e); } } @@ -76,11 +77,10 @@ public class GraphNodeExpandHandle { * 读取当前总图的存储信息 * @throws AWSException */ - private void readCurrentProcessDefine() throws AWSException{ - BaseModel baseModel = apiManager.getDefinition(repositoryId, 0); - if (baseModel == null) - throw new AWSException("未找到当前总图存储的模型信息"); - endToEndProcessDefine = JSONObject.parseObject(baseModel.getDefinition()); + private void readCurrentProcessDefine(String endToEndProcessDefineStr) throws AWSException{ + if (UtilString.isEmpty(endToEndProcessDefineStr)) + throw new AWSException("参数异常,模型存储信息未传"); + endToEndProcessDefine = JSONObject.parseObject(endToEndProcessDefineStr); } /** @@ -136,7 +136,7 @@ public class GraphNodeExpandHandle { scopeShapeProps.put("y", y); scopeShapeProps.put("w", scopeShapeW); scopeShapeProps.put("h", scopeShapeH); - scopeShapeProps.put("zindex", 1); + scopeShapeProps.put("zindex", 0); scopeLimitationShape.put("dataAttributes", currentExpandShape.getJSONArray("dataAttributes")); @@ -149,7 +149,7 @@ public class GraphNodeExpandHandle { * @throws Exception * @return 节点展开后的模型存储信息 */ - public String handleNodeExpand() throws Exception{ + public String handleNodeExpand() throws AWSException{ // Thread t1 = new Thread(() -> { // // 1、总图节点以及连线处理 @@ -393,53 +393,17 @@ public class GraphNodeExpandHandle { /** * 节点展开的邻接矩阵 */ -class NodeExpandAdjMatrix{ +class NodeExpandAdjMatrix extends AbstractAdjMatrix { - private int[][] adjMatrix; private List nodeIds; private List linkerList; public NodeExpandAdjMatrix(List nodeIds, List linkerList) { - this.adjMatrix = new int[nodeIds.size()][nodeIds.size()]; + super(nodeIds.size()); this.nodeIds = nodeIds; this.linkerList = linkerList; } - /** - * 添加一条从顶点 u 到顶点 v 的有向边。 - */ - public void addEdge(int u, int v) { - adjMatrix[u][v] = 1; // 设置邻接矩阵中相应的位置为 1 - } - - /** - * 获取从顶点 u 出发可以到达的所有顶点。 - */ - public List getNeighbors(int u) { - List neighbors = new ArrayList<>(); - for (int i = 0; i < nodeIds.size(); i++) { - if (adjMatrix[u][i] == 1) { - neighbors.add(i); - } - } - return neighbors; - } - - /** - * 判断从顶点 u 是否可以到达顶点 v。 - */ - public boolean hasEdge(int u, int v) { - return adjMatrix[u][v] == 1; - } - - /** - * 获取邻接矩阵 - * @return - */ - public int[][] getAdjMatrix(){ - return adjMatrix; - } - public List getNodeIds() { return nodeIds; } @@ -461,18 +425,6 @@ class NodeExpandAdjMatrix{ } } - // 输出邻接矩阵 - public void printAdjMatrix() { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < nodeIds.size(); i++) { - for (int j = 0; j < nodeIds.size(); j++) { - sb.append(adjMatrix[i][j]).append(" "); - } - sb.append("\n"); - } - System.out.println(sb.toString()); - } - /** * 获取总图中节点展开前的所有节点坐标 * @param elements @@ -535,7 +487,7 @@ class NodeExpandLinkerRender{ double[][] turnPoi = "horizontal".equals(direction) ? calculationLinkerPointInHorizLayOut(fromPoi, toPoi, currentExpandNodeIsStart, currentExpandNodeIsEnd) : calculationLinkerPointInVertLayOut(fromPoi, toPoi, currentExpandNodeIsStart, currentExpandNodeIsEnd); - double[] angleArr = calculationLinkerAngle(fromPoi, toPoi, turnPoi[1], turnPoi[turnPoi.length - 2]); + double[] angleArr = calculationLinkerAngle(turnPoi[0], turnPoi[turnPoi.length - 1], turnPoi[1], turnPoi[turnPoi.length - 2]); // 构建连线 JSONObject linkerObj = JSONObject.parseObject(LinkerDefConstant.linker); linkerObj.put("id", UUIDGener.getObjectId()); diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/component/AbstractAdjMatrix.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/component/AbstractAdjMatrix.java new file mode 100644 index 00000000..947940d4 --- /dev/null +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/component/AbstractAdjMatrix.java @@ -0,0 +1,61 @@ +package com.actionsoft.apps.coe.method.process.subprocess.graph.component; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author oYang + * @Description 邻接矩阵的基础类 + * @createTime 2023年06月09日 10:19:00 + */ +public abstract class AbstractAdjMatrix { + + private int[][] adjMatrix; // 邻接矩阵存储 + private int n; // 矩阵大小 + + public AbstractAdjMatrix(int n) { + this.adjMatrix = new int[n][n]; + this.n = n; + } + + /** + * 构建邻接矩阵 + */ + public abstract void buildAdjMatrix(); + + + /** + * 添加一条从顶点 u 到顶点 v 的有向边。 + */ + public void addEdge(int u, int v) { + adjMatrix[u][v] = 1; // 设置邻接矩阵中相应的位置为 1 + } + + /** + * 获取从顶点 u 出发可以到达的所有顶点。 + */ + public List getNeighbors(int u) { + List neighbors = new ArrayList<>(); + for (int i = 0; i < n; i++) { + if (adjMatrix[u][i] == 1) { + neighbors.add(i); + } + } + return neighbors; + } + + /** + * 判断从顶点 u 是否可以到达顶点 v。 + */ + public boolean hasEdge(int u, int v) { + return adjMatrix[u][v] == 1; + } + + /** + * 获取邻接矩阵 + * @return + */ + public int[][] getAdjMatrix(){ + return adjMatrix; + } +} diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/component/AbstractDefinitionHandle.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/component/AbstractDefinitionHandle.java new file mode 100644 index 00000000..11cebea7 --- /dev/null +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/component/AbstractDefinitionHandle.java @@ -0,0 +1,47 @@ +package com.actionsoft.apps.coe.method.process.subprocess.graph.component; + +import com.alibaba.fastjson.JSONObject; + +/** + * @author oYang + * @Description TODO + * @createTime 2023年06月09日 11:21:00 + */ +public abstract class AbstractDefinitionHandle { + + private final String definition; + + public AbstractDefinitionHandle(String definition) { + this.definition = definition; + } + + protected JSONObject getDefine(){ + JSONObject define = JSONObject.parseObject(definition); + return define; + } + + /** + * 获取 elements 属性 + * @return + */ + protected abstract JSONObject getElements(); + + /** + * 获取 processProperties 属性 + * @return + */ + protected abstract JSONObject getProcessProperties(); + + /** + * 删除 elements 属性中元素 + * @param key + */ + protected abstract void removeShape(String key); + + /** + * 添加元素到 elements + * @param key + * @param ele + */ + protected abstract void addEle(String key, JSONObject ele); +} diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/util/DefinitionThreadSafe.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/util/DefinitionThreadSafe.java new file mode 100644 index 00000000..b40c98fa --- /dev/null +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/util/DefinitionThreadSafe.java @@ -0,0 +1,56 @@ +package com.actionsoft.apps.coe.method.process.subprocess.graph.util; + +import com.actionsoft.apps.coe.method.process.subprocess.graph.component.AbstractDefinitionHandle; +import com.alibaba.fastjson.JSONObject; + +import java.util.concurrent.locks.ReentrantLock; + +/** + * @author oYang + * @Description 操作 definition 工具类 线程安全 + * @createTime 2023年06月09日 11:06:00 + */ +public class DefinitionThreadSafe extends AbstractDefinitionHandle { + + private final ReentrantLock lock = new ReentrantLock(); + + public DefinitionThreadSafe(String definition) { + super(definition); + } + + public JSONObject getElements(){ + lock.lock(); + try { + return getDefine().getJSONObject("elements"); + }finally { + lock.unlock(); + } + } + + public JSONObject getProcessProperties(){ + lock.lock(); + try{ + return getDefine().getJSONObject("processProperties"); + }finally { + lock.unlock(); + } + } + + public void removeShape(String key){ + lock.lock(); + try{ + getElements().remove(key); + }finally { + lock.unlock(); + } + } + + public void addEle(String key, JSONObject ele){ + lock.lock(); + try { + getElements().put(key, ele); + }finally { + lock.unlock(); + } + } +} diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/util/DefinitionThreadUnSafe.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/util/DefinitionThreadUnSafe.java new file mode 100644 index 00000000..533508e2 --- /dev/null +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/graph/util/DefinitionThreadUnSafe.java @@ -0,0 +1,36 @@ +package com.actionsoft.apps.coe.method.process.subprocess.graph.util; + +import com.actionsoft.apps.coe.method.process.subprocess.graph.component.AbstractDefinitionHandle; +import com.alibaba.fastjson.JSONObject; + +/** + * @author oYang + * @Description TODO + * @createTime 2023年06月09日 11:29:00 + */ +public class DefinitionThreadUnSafe extends AbstractDefinitionHandle { + + public DefinitionThreadUnSafe(String definition) { + super(definition); + } + + @Override + protected JSONObject getElements() { + return getDefine().getJSONObject("elements"); + } + + @Override + protected JSONObject getProcessProperties() { + return getDefine().getJSONObject("processProperties"); + } + + @Override + protected void removeShape(String key) { + getElements().remove(key); + } + + @Override + protected void addEle(String key, JSONObject ele) { + getElements().put(key, ele); + } +} diff --git a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java index 3242a782..6623998e 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java +++ b/com.actionsoft.apps.coe.method.process.subprocess/src/com/actionsoft/apps/coe/method/process/subprocess/web/SubProcessWeb.java @@ -312,14 +312,14 @@ public class SubProcessWeb extends ActionWeb { * @param shapeId 待展开的子流程节点ID * @param direction 布局方向 */ - public String shapeNodeExpand(String repositoryId, String shapeId){ + public String shapeNodeExpand(String repositoryId, String shapeId, String endToEndProcessDefineStr){ try { - GraphNodeExpandHandle nodeExpandHandle = new GraphNodeExpandHandle(repositoryId, shapeId); + GraphNodeExpandHandle nodeExpandHandle = new GraphNodeExpandHandle(repositoryId, shapeId, endToEndProcessDefineStr); String define = nodeExpandHandle.handleNodeExpand(); ResponseObject ro = ResponseObject.newOkResponse("节点展开成功"); ro.setData(define); return ro.toString(); - } catch (Exception e) { + } catch (AWSException e) { return ResponseObject.newErrResponse(e.getMessage()).toString(); } } diff --git a/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml b/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml index 6b37bcd8..e0075c2c 100644 --- a/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml +++ b/com.actionsoft.apps.coe.method.process.subprocess/web/com.actionsoft.apps.coe.method.process.subprocess/action.xml @@ -30,6 +30,7 @@ + diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js index ad9bf446..7ecdf922 100644 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/lib/designer/scripts/diagraming/designer.method.subprocess.js @@ -10,11 +10,6 @@ $(function(){ window.subProcess = subProcess; - // 连线框 鼠标指针样式设置 防止因为连线z-index层级较高 会导致节点展开图标点击不到 - $('.shape_box.linker_box').css({ - 'pointer-events': 'none' - }); - })(Model, ruuid, sid); }); @@ -33,6 +28,14 @@ class SubProcess { init(){ this.shapeIconRender(); this.handleScopeShapeEvent(); + this.linkerBoxPointerEvent(); + } + + linkerBoxPointerEvent(){ + // 连线框 鼠标指针样式设置 防止因为连线z-index层级较高 会导致节点展开图标点击不到 + $('.shape_box.linker_box').css({ + 'pointer-events': 'none' + }); } // 图形图标渲染 并绑定节点展开或者关闭事件 @@ -147,14 +150,17 @@ class SubProcess { cmd: 'com.actionsoft.apps.coe.method.process.subprocess.shape_expand', sid: param.sid, repositoryId: param.repositoryId, - shapeId: param.shapeId + shapeId: param.shapeId, + endToEndProcessDefineStr: JSON.stringify(param.Model.define) }, ok: function(r){ // console.log(JSON.stringify(r.data)); - definition = JSON.stringify(r.data); + definition.elements = r.data.elements; + definition.page = r.data.page; Designer.open(definition); // 节点重新渲染 // 针对范围标识框渲染 节点关闭按钮 window.subProcess.shapeIconRender(); + window.subProcess.linkerBoxPointerEvent(); window.subProcess.scopeShapeRenderTitle(param.shapeId, shapeText); // 提示用户文件已修改 window.subProcess.fileModifiedTip(); @@ -183,14 +189,16 @@ class SubProcess { sid: param.sid, repositoryId: param.repositoryId, shapeId: param.shapeId, - endToEndProcessDefineStr: definition + endToEndProcessDefineStr: JSON.stringify(param.Model.define) }, ok: function (r) { - definition = JSON.stringify(r.data); + definition.elements = r.data.elements; + definition.page = r.data.page; Designer.open(definition); // 节点重新渲染 // 针对范围标识框渲染 节点关闭按钮 window.subProcess.shapeIconRender(); + window.subProcess.linkerBoxPointerEvent(); // 提示用户文件已修改 window.subProcess.fileModifiedTip(); },