review: 代码审查
This commit is contained in:
parent
4b89f68936
commit
29a902f37e
|
@ -778,9 +778,16 @@ public class BpmnModelUtils {
|
||||||
if (currentElement instanceof ExclusiveGateway) {
|
if (currentElement instanceof ExclusiveGateway) {
|
||||||
// 查找满足条件的 SequenceFlow 路径
|
// 查找满足条件的 SequenceFlow 路径
|
||||||
Gateway gateway = (Gateway) currentElement;
|
Gateway gateway = (Gateway) currentElement;
|
||||||
SequenceFlow matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
SequenceFlow matchSequenceFlow;
|
||||||
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
// 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
|
||||||
&& (evalConditionExpress(variables, flow.getConditionExpression())));
|
if (null == variables) {
|
||||||
|
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||||
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
|
||||||
|
} else {
|
||||||
|
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||||
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
||||||
|
&& (evalConditionExpress(variables, flow.getConditionExpression())));
|
||||||
|
}
|
||||||
if (matchSequenceFlow == null) {
|
if (matchSequenceFlow == null) {
|
||||||
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
||||||
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
||||||
|
@ -800,9 +807,15 @@ public class BpmnModelUtils {
|
||||||
if (currentElement instanceof InclusiveGateway) {
|
if (currentElement instanceof InclusiveGateway) {
|
||||||
// 查找满足条件的 SequenceFlow 路径
|
// 查找满足条件的 SequenceFlow 路径
|
||||||
Gateway gateway = (Gateway) currentElement;
|
Gateway gateway = (Gateway) currentElement;
|
||||||
Collection<SequenceFlow> matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
Collection<SequenceFlow> matchSequenceFlows;
|
||||||
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
if (null == variables){
|
||||||
&& evalConditionExpress(variables, flow.getConditionExpression()));
|
matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
||||||
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
|
||||||
|
}else {
|
||||||
|
matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
||||||
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
||||||
|
&& evalConditionExpress(variables, flow.getConditionExpression()));
|
||||||
|
}
|
||||||
if (CollUtil.isEmpty(matchSequenceFlows)) {
|
if (CollUtil.isEmpty(matchSequenceFlows)) {
|
||||||
matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
||||||
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
||||||
|
|
|
@ -808,9 +808,15 @@ public class SimpleModelUtils {
|
||||||
// 情况:CONDITION_BRANCH_NODE 排它,只有一个满足条件的。如果没有,就走默认的
|
// 情况:CONDITION_BRANCH_NODE 排它,只有一个满足条件的。如果没有,就走默认的
|
||||||
if (nodeType == BpmSimpleModelNodeTypeEnum.CONDITION_BRANCH_NODE) {
|
if (nodeType == BpmSimpleModelNodeTypeEnum.CONDITION_BRANCH_NODE) {
|
||||||
// 查找满足条件的 BpmSimpleModelNodeVO 节点
|
// 查找满足条件的 BpmSimpleModelNodeVO 节点
|
||||||
BpmSimpleModelNodeVO matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
|
BpmSimpleModelNodeVO matchConditionNode;
|
||||||
conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow())
|
if(null == variables) {
|
||||||
&& evalConditionExpress(variables, conditionNode.getConditionSetting()));
|
matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
|
||||||
|
conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
|
||||||
|
}else {
|
||||||
|
matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
|
||||||
|
conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow())
|
||||||
|
&& evalConditionExpress(variables, conditionNode.getConditionSetting()));
|
||||||
|
}
|
||||||
if (matchConditionNode == null) {
|
if (matchConditionNode == null) {
|
||||||
matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
|
matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
|
||||||
conditionNode -> BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
|
conditionNode -> BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
|
||||||
|
@ -823,9 +829,15 @@ public class SimpleModelUtils {
|
||||||
// 情况:INCLUSIVE_BRANCH_NODE 包容,多个满足条件的。如果没有,就走默认的
|
// 情况:INCLUSIVE_BRANCH_NODE 包容,多个满足条件的。如果没有,就走默认的
|
||||||
if (nodeType == BpmSimpleModelNodeTypeEnum.INCLUSIVE_BRANCH_NODE) {
|
if (nodeType == BpmSimpleModelNodeTypeEnum.INCLUSIVE_BRANCH_NODE) {
|
||||||
// 查找满足条件的 BpmSimpleModelNodeVO 节点
|
// 查找满足条件的 BpmSimpleModelNodeVO 节点
|
||||||
Collection<BpmSimpleModelNodeVO> matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
|
Collection<BpmSimpleModelNodeVO> matchConditionNodes;
|
||||||
conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow())
|
if (null == variables) {
|
||||||
&& evalConditionExpress(variables, conditionNode.getConditionSetting()));
|
matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
|
||||||
|
conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
|
||||||
|
}else {
|
||||||
|
matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
|
||||||
|
conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow())
|
||||||
|
&& evalConditionExpress(variables, conditionNode.getConditionSetting()));
|
||||||
|
}
|
||||||
if (CollUtil.isEmpty(matchConditionNodes)) {
|
if (CollUtil.isEmpty(matchConditionNodes)) {
|
||||||
matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
|
matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
|
||||||
conditionNode -> BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
|
conditionNode -> BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
|
||||||
|
|
|
@ -208,11 +208,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
|
||||||
// TODO @jason:有一个极端情况,如果一个用户有 2 个 task A 和 B,A 已经通过,B 需要审核。这个时,通过 A 进来,todo 拿到
|
// TODO @jason:有一个极端情况,如果一个用户有 2 个 task A 和 B,A 已经通过,B 需要审核。这个时,通过 A 进来,todo 拿到
|
||||||
// B,会不会表单权限不一致哈。
|
// B,会不会表单权限不一致哈。
|
||||||
BpmTaskRespVO todoTask = taskService.getFirstTodoTask(loginUserId, reqVO.getProcessInstanceId());
|
BpmTaskRespVO todoTask = taskService.getFirstTodoTask(loginUserId, reqVO.getProcessInstanceId());
|
||||||
// 3.2 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
|
// 3.2 预测未运行节点的审批信息
|
||||||
if (null == processVariables) {
|
|
||||||
processVariables = new HashMap<>();
|
|
||||||
}
|
|
||||||
// 3.3 预测未运行节点的审批信息
|
|
||||||
List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel,
|
List<ActivityNode> simulateActivityNodes = getSimulateApproveNodeList(startUserId, bpmnModel,
|
||||||
processDefinitionInfo,
|
processDefinitionInfo,
|
||||||
processVariables, activities);
|
processVariables, activities);
|
||||||
|
|
Loading…
Reference in New Issue