修改流程实例图中流转顺序问题
This commit is contained in:
parent
7c624e7482
commit
5d3ea2f478
@ -188,8 +188,7 @@ public class ActivitiModelServiceImpl extends DefaultBaseService implements IAct
|
||||
List<String> highLightedActivitiIds = new ArrayList<>();
|
||||
if (processInstance != null) {
|
||||
List<String> activeActivityIds = runtimeService.getActiveActivityIds(processInstance.getId());
|
||||
highLightedActivitiIds.addAll(activeActivityIds);
|
||||
// 获取历史节点
|
||||
// 先添加历史节点
|
||||
List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).list();
|
||||
if (!historicActivityInstances.isEmpty()) {
|
||||
for (HistoricActivityInstance historicActivityInstance : historicActivityInstances) {
|
||||
@ -199,6 +198,8 @@ public class ActivitiModelServiceImpl extends DefaultBaseService implements IAct
|
||||
highLightedActivitiIds.add("#" + historicActivityInstance.getActivityId());
|
||||
}
|
||||
}
|
||||
// 添加现有节点
|
||||
highLightedActivitiIds.addAll(activeActivityIds);
|
||||
}
|
||||
List<String> listSequenceFlows = listSequenceFlows(bpmnModel, highLightedActivitiIds);
|
||||
CustomProcessDiagramGenerator customProcessDiagramGenerator = new CustomProcessDiagramGenerator();
|
||||
@ -238,12 +239,12 @@ public class ActivitiModelServiceImpl extends DefaultBaseService implements IAct
|
||||
List<FlowNode> flowElementsOfType = bpmnModel.getProcesses().get(0).findFlowElementsOfType(FlowNode.class);
|
||||
List<FlowNode> activitiFlowNode = new ArrayList<>();
|
||||
// 加载高亮的节点
|
||||
for (FlowNode flowNode : flowElementsOfType) {
|
||||
for (String highLightedActivitiId : highLightedActivitiIds) {
|
||||
String activitiId = highLightedActivitiId;
|
||||
if (activitiId.startsWith("#")) {
|
||||
activitiId = highLightedActivitiId.substring(1);
|
||||
}
|
||||
for (String highLightedActivitiId : highLightedActivitiIds) {
|
||||
String activitiId = highLightedActivitiId;
|
||||
if (activitiId.startsWith("#")) {
|
||||
activitiId = highLightedActivitiId.substring(1);
|
||||
}
|
||||
for (FlowNode flowNode : flowElementsOfType) {
|
||||
if (StringUtils.equals(flowNode.getId(), activitiId)) {
|
||||
activitiFlowNode.add(flowNode);
|
||||
break;
|
||||
@ -253,26 +254,15 @@ public class ActivitiModelServiceImpl extends DefaultBaseService implements IAct
|
||||
// 找出高亮节点之间的连线
|
||||
for (int i = 0; i < activitiFlowNode.size() - 1; i++) {
|
||||
FlowNode flowNode = activitiFlowNode.get(i);
|
||||
List<SequenceFlow> incomingFlows = flowNode.getIncomingFlows();
|
||||
List<SequenceFlow> outgoingFlows = flowNode.getOutgoingFlows();
|
||||
for (int j = 0; j < activitiFlowNode.size(); j++) {
|
||||
FlowNode nextFlowNode = activitiFlowNode.get(j);
|
||||
List<SequenceFlow> nextIncomingFlows = nextFlowNode.getIncomingFlows();
|
||||
List<SequenceFlow> nextOutgoingFlows = nextFlowNode.getOutgoingFlows();
|
||||
// 前节点的出与后节点的入相同,则有关系
|
||||
for (SequenceFlow outgoingFlow : outgoingFlows) {
|
||||
for (SequenceFlow nextIncomingFlow : nextIncomingFlows) {
|
||||
if (StringUtils.equals(outgoingFlow.getId(), nextIncomingFlow.getId())) {
|
||||
flowSet.add(outgoingFlow.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 前节点的入与后节点的出相同,则有关系
|
||||
for (SequenceFlow incomingFlow : incomingFlows) {
|
||||
for (SequenceFlow nextOutgoingFlow : nextOutgoingFlows) {
|
||||
if (StringUtils.equals(incomingFlow.getId(), nextOutgoingFlow.getId())) {
|
||||
flowSet.add(incomingFlow.getId());
|
||||
}
|
||||
|
||||
FlowNode nextFlowNode = activitiFlowNode.get(i + 1);
|
||||
List<SequenceFlow> nextIncomingFlows = nextFlowNode.getIncomingFlows();
|
||||
// 前节点的出与后节点的入相同,则有关系
|
||||
for (SequenceFlow outgoingFlow : outgoingFlows) {
|
||||
for (SequenceFlow nextIncomingFlow : nextIncomingFlows) {
|
||||
if (StringUtils.equals(outgoingFlow.getId(), nextIncomingFlow.getId())) {
|
||||
flowSet.add(outgoingFlow.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user