架构筛选文件类型初始化条件缺失制度图&模型转换文件提交
This commit is contained in:
parent
0790e9664e
commit
598976016d
Binary file not shown.
@ -0,0 +1,22 @@
|
||||
package com.actionsoft.apps.coe.pal;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.modelconvert.ModelConvertWeb;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
||||
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
||||
|
||||
@Controller
|
||||
public class ModelConvertController {
|
||||
|
||||
@Mapping("com.actionsoft.apps.coe.pal.handle_epc_to_flowchart")
|
||||
public String handleEpcToFlowChart(UserContext uc,String repositoryId,String sourceMethod,String targetMethod){
|
||||
ModelConvertWeb modelConvertWeb = new ModelConvertWeb(uc);
|
||||
return modelConvertWeb.handleEpcToFlowChart(repositoryId,sourceMethod,targetMethod);
|
||||
}
|
||||
|
||||
@Mapping("com.actionsoft.apps.coe.pal.handle_epc_to_flowchart_batch")
|
||||
public String handleEpcToFlowChartBatch(UserContext uc,String repositoryIds,String sourceMethod,String targetMethod){
|
||||
ModelConvertWeb modelConvertWeb = new ModelConvertWeb(uc);
|
||||
return modelConvertWeb.handleEpcToFlowChartBatch(repositoryIds,sourceMethod,targetMethod);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.modelconvert;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.pal.modelconvert.constant.ModelConvertConst;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.util.UUIDGener;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class ModelConvertWeb extends ActionWeb {
|
||||
|
||||
private UserContext uc;
|
||||
|
||||
public ModelConvertWeb(UserContext uc) {
|
||||
super(uc);
|
||||
this.uc = uc;
|
||||
}
|
||||
|
||||
public String handleEpcToFlowChart(String repositoryId,String sourceMethod,String targetMethod){
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
params.put("sid",uc.getSessionId());
|
||||
params.put("repositoryId",repositoryId);
|
||||
params.put("sourceMethod",sourceMethod);
|
||||
params.put("targetMethod",targetMethod);
|
||||
ResponseObject ro = SDK.getAppAPI().callASLP(SDK.getAppAPI().getAppContext(ModelConvertConst.APP_ID), ModelConvertConst.ASLP_SINGLE_CONVERT, params);
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
public String handleEpcToFlowChartBatch(String repositoryIds,String sourceMethod,String targetMethod){
|
||||
JSONArray array = JSONArray.parseArray(repositoryIds);
|
||||
List<String> repositoryIdList = array.stream().map(id -> (String) id).collect(Collectors.toList());
|
||||
Map<String,Object> params = new HashMap<String, Object>();
|
||||
params.put("sid",uc.getSessionId());
|
||||
params.put("repositoryId",repositoryIdList);
|
||||
params.put("sourceMethod",sourceMethod);
|
||||
params.put("targetMethod",targetMethod);
|
||||
ResponseObject ro = SDK.getAppAPI().callASLP(SDK.getAppAPI().getAppContext(ModelConvertConst.APP_ID), ModelConvertConst.ASLP_SINGLE_CONVERT, params);
|
||||
return ro.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.actionsoft.apps.coe.pal.pal.modelconvert.constant;
|
||||
|
||||
public class ModelConvertConst {
|
||||
|
||||
// 模型转换应用ID
|
||||
public static final String APP_ID = "com.actionsoft.apps.coe.pal.modelconvert";
|
||||
|
||||
// 单个模型转换的ASLP地址
|
||||
public static final String ASLP_SINGLE_CONVERT = "aslp://com.actionsoft.apps.coe.pal.modelconvert/modelConvert";
|
||||
|
||||
// 批量模型转换的ASLP地址
|
||||
public static final String ASLP_BATCH_CONVERT = "aslp://com.actionsoft.apps.coe.pal.modelconvert/modelConvertBatch";
|
||||
}
|
||||
@ -1380,4 +1380,65 @@ public class ShapeUtil {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程节点定义
|
||||
* @param methodId 类型
|
||||
* @param shapeTitle 节点默认标题
|
||||
* @return
|
||||
*/
|
||||
public static JSONObject getProcessShapeDefinition(String methodId, String shapeTitle) {
|
||||
JSONArray shapes = CoeDesignerUtil.getShapeDefinition(methodId);
|
||||
for (Object shape : shapes) {
|
||||
JSONObject shapeObj = (JSONObject) shape;
|
||||
if (shapeObj.containsKey("title")) {
|
||||
if (methodId.contains("bpmn")) {
|
||||
if (bpmnShapeScope().contains(shapeObj.getString("name")) && shapeObj.getString("title").equals(shapeTitle)) {
|
||||
return shapeObj;
|
||||
}
|
||||
} else {
|
||||
if (shapeObj.getString("title").equals(shapeTitle)) {
|
||||
return shapeObj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* BPMN图并不全部使用,给定范围
|
||||
*/
|
||||
private static List<String> bpmnShapeScope() {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("startEvent");// 开始事件
|
||||
list.add("messageStartEvent");// 消息开始事件
|
||||
list.add("timerStartEvent");// 时间开始事件
|
||||
list.add("signalStartEvent");// 信号开始事件
|
||||
list.add("userTask");// 人工任务
|
||||
list.add("serviceTask");// 服务任务
|
||||
list.add("manualTask");// 手工任务
|
||||
list.add("scriptTask");// 脚本任务
|
||||
list.add("inclusiveGateway");// 包容网关
|
||||
list.add("complexGateway");// 复杂网关
|
||||
list.add("eventBasedGateway");// 事件网关
|
||||
list.add("parallelGateway");// 并行网关
|
||||
list.add("exclusiveGateway");// 排他网关
|
||||
list.add("timerIntermediateCatchEvent");// 捕获时间事件
|
||||
list.add("messageIntermediateCatchEvent");// 捕获消息事件
|
||||
list.add("signalIntermediateCatchEvent");// 捕获信号事件
|
||||
list.add("messageIntermediateThrowingEvent");// 抛出消息事件
|
||||
list.add("signalIntermediateThrowingEvent");// 抛出信号事件
|
||||
list.add("messageBoundaryInterrputingEvent");// 边界消息事件
|
||||
list.add("signalBoundaryInterrputingEvent");// 边界信号事件
|
||||
list.add("errorBoundaryInterrputingEvent");// 边界错误事件
|
||||
list.add("endEvent");// 结束事件
|
||||
list.add("terminateEndEvent");// 终止事件
|
||||
list.add("messageEndEvent");// 消息结束事件
|
||||
list.add("signalEndEvent");// 信号结束事件
|
||||
list.add("errorEndEvent");// 错误结束事件
|
||||
list.add("callActivityCallingProcess");// 调用子流程
|
||||
list.add("group");// 组
|
||||
// list.add("textAnnotation");// 注释
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12049,7 +12049,7 @@ public String deleteReply(String replyid, String messageid) {
|
||||
JSONArray methodIds = new JSONArray();
|
||||
List<PALMethodModel> process = PALMethodCache.getPALMethodModelListByMethod("process");
|
||||
for (PALMethodModel methodModel : process) {
|
||||
if ("process.epc".equals(methodModel.getId()) || "process.bpmn2".equals(methodModel.getId())
|
||||
if ("control.policy".equals(methodModel.getId()) || "process.epc".equals(methodModel.getId()) || "process.bpmn2".equals(methodModel.getId())
|
||||
|| "process.flowchart".equals(methodModel.getId()) || "process.evc".equals(methodModel.getId())) {
|
||||
JSONObject methodId = new JSONObject();
|
||||
methodId.put("methodId",methodModel.getId());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user