fix: 修复流程分支节点预测问题
This commit is contained in:
parent
3d20ce1a9b
commit
1023afda40
|
@ -32,7 +32,7 @@ import static org.flowable.bpmn.constants.BpmnXMLConstants.FLOWABLE_EXTENSIONS_P
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BPMN Model 操作工具类。目前分成三部分:
|
* BPMN Model 操作工具类。目前分成三部分:
|
||||||
*
|
* <p>
|
||||||
* 1. BPMN 修改 + 解析元素相关的方法
|
* 1. BPMN 修改 + 解析元素相关的方法
|
||||||
* 2. BPMN 简单查找相关的方法
|
* 2. BPMN 简单查找相关的方法
|
||||||
* 3. BPMN 复杂遍历相关的方法
|
* 3. BPMN 复杂遍历相关的方法
|
||||||
|
@ -150,9 +150,9 @@ public class BpmnModelUtils {
|
||||||
/**
|
/**
|
||||||
* 解析审批类型
|
* 解析审批类型
|
||||||
*
|
*
|
||||||
* @see BpmUserTaskApproveTypeEnum
|
|
||||||
* @param userTask 任务节点
|
* @param userTask 任务节点
|
||||||
* @return 审批类型
|
* @return 审批类型
|
||||||
|
* @see BpmUserTaskApproveTypeEnum
|
||||||
*/
|
*/
|
||||||
public static Integer parseApproveType(FlowElement userTask) {
|
public static Integer parseApproveType(FlowElement userTask) {
|
||||||
return NumberUtils.parseInt(parseExtensionElement(userTask, BpmnModelConstants.USER_TASK_APPROVE_TYPE));
|
return NumberUtils.parseInt(parseExtensionElement(userTask, BpmnModelConstants.USER_TASK_APPROVE_TYPE));
|
||||||
|
@ -196,9 +196,9 @@ public class BpmnModelUtils {
|
||||||
/**
|
/**
|
||||||
* 给节点添加用户任务的审批人与发起人相同时,处理类型枚举
|
* 给节点添加用户任务的审批人与发起人相同时,处理类型枚举
|
||||||
*
|
*
|
||||||
* @see BpmUserTaskAssignStartUserHandlerTypeEnum
|
|
||||||
* @param assignStartUserHandlerType 发起人处理类型
|
* @param assignStartUserHandlerType 发起人处理类型
|
||||||
* @param userTask 任务节点
|
* @param userTask 任务节点
|
||||||
|
* @see BpmUserTaskAssignStartUserHandlerTypeEnum
|
||||||
*/
|
*/
|
||||||
public static void addAssignStartUserHandlerType(Integer assignStartUserHandlerType, UserTask userTask) {
|
public static void addAssignStartUserHandlerType(Integer assignStartUserHandlerType, UserTask userTask) {
|
||||||
if (assignStartUserHandlerType == null) {
|
if (assignStartUserHandlerType == null) {
|
||||||
|
@ -210,9 +210,9 @@ public class BpmnModelUtils {
|
||||||
/**
|
/**
|
||||||
* 给节点添加用户任务的审批人为空时,处理类型枚举
|
* 给节点添加用户任务的审批人为空时,处理类型枚举
|
||||||
*
|
*
|
||||||
* @see BpmUserTaskAssignEmptyHandlerTypeEnum
|
|
||||||
* @param emptyHandler 空处理
|
* @param emptyHandler 空处理
|
||||||
* @param userTask 任务节点
|
* @param userTask 任务节点
|
||||||
|
* @see BpmUserTaskAssignEmptyHandlerTypeEnum
|
||||||
*/
|
*/
|
||||||
public static void addAssignEmptyHandlerType(BpmSimpleModelNodeVO.AssignEmptyHandler emptyHandler, UserTask userTask) {
|
public static void addAssignEmptyHandlerType(BpmSimpleModelNodeVO.AssignEmptyHandler emptyHandler, UserTask userTask) {
|
||||||
if (emptyHandler == null) {
|
if (emptyHandler == null) {
|
||||||
|
@ -778,10 +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;
|
||||||
|
//流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
|
||||||
|
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())
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
||||||
//流程第一次发起时,variables条件值一定为空,发生异常会导致后续分支节点无法预测,
|
&& (evalConditionExpress(variables, flow.getConditionExpression())));
|
||||||
|| (null != variables && 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()));
|
||||||
|
|
Loading…
Reference in New Issue