|
@@ -332,9 +332,8 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
}
|
|
|
|
|
|
flowExample.setVersion(dto.getVersion());
|
|
|
-
|
|
|
- boolean b = flowExampleService.updateById(flowExample);
|
|
|
- if (!b) {
|
|
|
+ boolean updateFlag = flowExampleService.updateById(flowExample);
|
|
|
+ if (!updateFlag) {
|
|
|
throw new ServiceException("流程已被处理");
|
|
|
}
|
|
|
flowExampleDetailService.saveBatch(flowExampleDetailList);
|
|
@@ -371,7 +370,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
invokeMethod(flowDelegate, handlingMethod);
|
|
|
} else {
|
|
|
// 执行默认方法
|
|
|
- flowDelegate.end();
|
|
|
+ flowDelegate.end(FlowThreadLocalUtil.getFlowId(), FlowThreadLocalUtil.getCurrentData());
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("结束节点方法异常", e);
|
|
@@ -405,8 +404,8 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
*/
|
|
|
private FlowDefinitionNode getNextUserNode(FlowDefinitionNode currentNode, List<FlowDefinitionNode> flowDefinitionNodeList) {
|
|
|
// 父级节点map
|
|
|
- Map<Long, List<FlowDefinitionNode>> parentNodeMap = flowDefinitionNodeList.stream()
|
|
|
- .collect(Collectors.groupingBy(FlowDefinitionNode::getParentId));
|
|
|
+ Map<Long, List<FlowDefinitionNode>> parentNodeMap =
|
|
|
+ flowDefinitionNodeList.stream().collect(Collectors.groupingBy(FlowDefinitionNode::getParentId));
|
|
|
// 查找下个节点
|
|
|
List<FlowDefinitionNode> nextNodeList = parentNodeMap.get(currentNode.getId());
|
|
|
FlowDefinitionNode nextNode = null;
|
|
@@ -504,25 +503,24 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
flowResult.setSuccess(false);
|
|
|
flowResult.setUserList(userList);
|
|
|
return flowResult;
|
|
|
+ default:
|
|
|
+ throw new ServiceException("未知用户处理类型");
|
|
|
}
|
|
|
|
|
|
- return flowResult;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 校验el表达式
|
|
|
*/
|
|
|
public boolean expressionResult(Map<String, Object> map, String expression) {
|
|
|
- boolean result;
|
|
|
try {
|
|
|
Expression exp = AviatorEvaluator.compile(expression);
|
|
|
Object execute = exp.execute(map);
|
|
|
- result = Boolean.parseBoolean(String.valueOf(execute));
|
|
|
+ return Boolean.parseBoolean(String.valueOf(execute));
|
|
|
} catch (Exception e) {
|
|
|
log.error("el表达式校验错误", e);
|
|
|
throw new ServiceException("el表达式校验错误:" + e.getMessage());
|
|
|
}
|
|
|
- return result;
|
|
|
}
|
|
|
|
|
|
}
|