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
@ -23,6 +23,8 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
|
||||
// 抄送人节点、对应 BPMN 的 ScriptTask. 使用ScriptTask 原因。好像 ServiceTask 自定义属性不能写入 XML
|
||||
SCRIPT_TASK_NODE(2, "抄送人节点"),
|
||||
EXCLUSIVE_GATEWAY_NODE(4, "排他网关"),
|
||||
PARALLEL_GATEWAY_FORK_NODE(5, "并行网关分叉节点"),
|
||||
PARALLEL_GATEWAY_JOIN_NODE(6, "并行网关聚合节点"),
|
||||
END_EVENT_NODE(-2, "结束节点");
|
||||
|
||||
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) {
|
||||
// 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) {
|
||||
|
@ -385,12 +385,14 @@ public class BpmnModelUtils {
|
||||
switch (nodeType) {
|
||||
case START_EVENT_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);
|
||||
// 递归调用后续节点
|
||||
addBpmnSequenceFlow(mainProcess, childNode, endId);
|
||||
break;
|
||||
}
|
||||
case PARALLEL_GATEWAY_FORK_NODE:
|
||||
case EXCLUSIVE_GATEWAY_NODE: {
|
||||
String gateWayEndId = (childNode == null || childNode.getId() == null) ? BpmnModelConstants.END_EVENT_ID : childNode.getId();
|
||||
List<BpmSimpleModelNodeVO> conditionNodes = node.getConditionNodes();
|
||||
@ -449,6 +451,10 @@ public class BpmnModelUtils {
|
||||
case EXCLUSIVE_GATEWAY_NODE:
|
||||
addBpmnExclusiveGatewayNode(mainProcess, simpleModelNode);
|
||||
break;
|
||||
case PARALLEL_GATEWAY_FORK_NODE:
|
||||
case PARALLEL_GATEWAY_JOIN_NODE:
|
||||
addBpmnParallelGatewayNode(mainProcess, simpleModelNode);
|
||||
break;
|
||||
default: {
|
||||
// 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) {
|
||||
ScriptTask scriptTask = new ScriptTask();
|
||||
scriptTask.setId(node.getId());
|
||||
|
Loading…
Reference in New Issue
Block a user