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