mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-19 03:30:06 +08:00
仿钉钉流程设计-并行网关的实现
This commit is contained in:
parent
32809c3edb
commit
df936deeca
@ -19,10 +19,12 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
|||||||
|
|
||||||
// TODO @jaosn:-1、0、1、4、-2 是前端已经定义好的么?感觉未来可以考虑搞成和 BPMN 尽量一致的单词哈;类似 usertask 用户审批;
|
// TODO @jaosn:-1、0、1、4、-2 是前端已经定义好的么?感觉未来可以考虑搞成和 BPMN 尽量一致的单词哈;类似 usertask 用户审批;
|
||||||
START_EVENT_NODE(0, "开始节点"),
|
START_EVENT_NODE(0, "开始节点"),
|
||||||
APPROVE_USER_NODE (1, "审批人节点"),
|
APPROVE_USER_NODE(1, "审批人节点"),
|
||||||
// 抄送人节点、对应 BPMN 的 ScriptTask. 使用ScriptTask 原因。好像 ServiceTask 自定义属性不能写入 XML
|
// 抄送人节点、对应 BPMN 的 ScriptTask. 使用ScriptTask 原因。好像 ServiceTask 自定义属性不能写入 XML
|
||||||
SCRIPT_TASK_NODE(2, "抄送人节点"),
|
SCRIPT_TASK_NODE(2, "抄送人节点"),
|
||||||
EXCLUSIVE_GATEWAY_NODE(4, "排他网关"),
|
EXCLUSIVE_GATEWAY_NODE(4, "排他网关"),
|
||||||
|
PARALLEL_GATEWAY_FORK_NODE(5, "并行网关分叉节点"),
|
||||||
|
PARALLEL_GATEWAY_JOIN_NODE(6, "并行网关聚合节点"),
|
||||||
END_EVENT_NODE(-2, "结束节点");
|
END_EVENT_NODE(-2, "结束节点");
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
|
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
|
||||||
@ -32,7 +34,8 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
|||||||
|
|
||||||
public static boolean isGatewayNode(Integer type) {
|
public static boolean isGatewayNode(Integer type) {
|
||||||
// TODO 后续增加并行网关的支持
|
// TODO 后续增加并行网关的支持
|
||||||
return Objects.equals(EXCLUSIVE_GATEWAY_NODE.getType(), type);
|
return Objects.equals(EXCLUSIVE_GATEWAY_NODE.getType(), type)
|
||||||
|
|| Objects.equals(PARALLEL_GATEWAY_FORK_NODE.getType(), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BpmSimpleModelNodeType valueOf(Integer type) {
|
public static BpmSimpleModelNodeType valueOf(Integer type) {
|
||||||
|
@ -385,12 +385,14 @@ public class BpmnModelUtils {
|
|||||||
switch (nodeType) {
|
switch (nodeType) {
|
||||||
case START_EVENT_NODE:
|
case START_EVENT_NODE:
|
||||||
case APPROVE_USER_NODE:
|
case APPROVE_USER_NODE:
|
||||||
case SCRIPT_TASK_NODE: {
|
case SCRIPT_TASK_NODE:
|
||||||
|
case PARALLEL_GATEWAY_JOIN_NODE:{
|
||||||
addBpmnSequenceFlowElement(mainProcess, node.getId(), childNode.getId(), null, null);
|
addBpmnSequenceFlowElement(mainProcess, node.getId(), childNode.getId(), null, null);
|
||||||
// 递归调用后续节点
|
// 递归调用后续节点
|
||||||
addBpmnSequenceFlow(mainProcess, childNode, endId);
|
addBpmnSequenceFlow(mainProcess, childNode, endId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case PARALLEL_GATEWAY_FORK_NODE:
|
||||||
case EXCLUSIVE_GATEWAY_NODE: {
|
case EXCLUSIVE_GATEWAY_NODE: {
|
||||||
String gateWayEndId = (childNode == null || childNode.getId() == null) ? BpmnModelConstants.END_EVENT_ID : childNode.getId();
|
String gateWayEndId = (childNode == null || childNode.getId() == null) ? BpmnModelConstants.END_EVENT_ID : childNode.getId();
|
||||||
List<BpmSimpleModelNodeVO> conditionNodes = node.getConditionNodes();
|
List<BpmSimpleModelNodeVO> conditionNodes = node.getConditionNodes();
|
||||||
@ -449,6 +451,10 @@ public class BpmnModelUtils {
|
|||||||
case EXCLUSIVE_GATEWAY_NODE:
|
case EXCLUSIVE_GATEWAY_NODE:
|
||||||
addBpmnExclusiveGatewayNode(mainProcess, simpleModelNode);
|
addBpmnExclusiveGatewayNode(mainProcess, simpleModelNode);
|
||||||
break;
|
break;
|
||||||
|
case PARALLEL_GATEWAY_FORK_NODE:
|
||||||
|
case PARALLEL_GATEWAY_JOIN_NODE:
|
||||||
|
addBpmnParallelGatewayNode(mainProcess, simpleModelNode);
|
||||||
|
break;
|
||||||
default: {
|
default: {
|
||||||
// TODO 其它节点类型的实现
|
// TODO 其它节点类型的实现
|
||||||
}
|
}
|
||||||
@ -472,6 +478,12 @@ public class BpmnModelUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addBpmnParallelGatewayNode(Process mainProcess, BpmSimpleModelNodeVO node) {
|
||||||
|
ParallelGateway parallelGateway = new ParallelGateway();
|
||||||
|
parallelGateway.setId(node.getId());
|
||||||
|
mainProcess.addFlowElement(parallelGateway);
|
||||||
|
}
|
||||||
|
|
||||||
private static void addBpmnScriptTaSskNode(Process mainProcess, BpmSimpleModelNodeVO node) {
|
private static void addBpmnScriptTaSskNode(Process mainProcess, BpmSimpleModelNodeVO node) {
|
||||||
ScriptTask scriptTask = new ScriptTask();
|
ScriptTask scriptTask = new ScriptTask();
|
||||||
scriptTask.setId(node.getId());
|
scriptTask.setId(node.getId());
|
||||||
|
Loading…
Reference in New Issue
Block a user