```/**
* 递归寻找上一个节点
* @param bpmnModel
* @param elementKey
* @param nameList
*/
private void getUserTask( BpmnModel bpmnModel, String elementKey, List<UserTask> nameList) {
//获取当前节点信息
FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(elementKey);
//获取当前节点输出连线
List<SequenceFlow> incomingFlows = flowNode.getIncomingFlows();
//遍历输出连线
for (SequenceFlow incomingFlow : incomingFlows) {
//获取输出节点元素
org.activiti.bpmn.model.FlowElement sourceFlowElement = incomingFlow.getSourceFlowElement();
//排除非用户任务接点
if (sourceFlowElement instanceof UserTask) {
//判断输出节点的el表达式
//true 获取输出节点名称
nameList.add((UserTask) sourceFlowElement);
break;
} else {
getUserTask(bpmnModel, sourceFlowElement.getId(), nameList);
}
}
}
activiti:6.0递归寻找上一个节点
最新推荐文章于 2022-12-09 17:59:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)