Skip to content

Commit

Permalink
Update BPMNDiscovery.java
Browse files Browse the repository at this point in the history
  • Loading branch information
NourEldin-Ali committed Jun 11, 2024
1 parent 61768c1 commit 276cbb0
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ public BPMNDiscovery(List<String> startsEvent, List<String> endsEvent, LinkedLis
public void DependencyGraphToBPMN() throws BPMNModelException, CloneNotSupportedException {

BPMNProcess process = model.openDefaultProces();


// it is used for the sequence flow
for (String dependency : dependencies) {
Expand Down Expand Up @@ -1202,18 +1201,13 @@ private void loopBlockConstruction(List<BPMNElementNode> sourceElements, List<BP
+ sourceElements.stream().map(src -> src.getId()).collect(Collectors.toList()));
String tempActivity = "___temp___";
BPMNElementNode tempElement = process.addTask(tempActivity, tempActivity, BPMNTypes.TASK);
System.out.println(tempElement.getId());
for (String target : targetIds) {
BPMNElementNode targetElement = process.findElementNodeById(target);
System.out.println(targetElement.getId());
if (tempElement.getOutgoingSequenceFlows().size() > 0) {
addSplitGateway(tempElement, targetElement);
splitGateway = null;
// probably XOR join
// if (targetElement.getIngoingSequenceFlows().size() > 1) {
// addXorGateway(process, targetElement);
// }
// splitGateway = null;

} else {
process.addSequenceFlow("sq-" + seqenceFlowId.toString(), tempActivity, target);
seqenceFlowId++;
Expand All @@ -1224,8 +1218,15 @@ private void loopBlockConstruction(List<BPMNElementNode> sourceElements, List<BP
process.deleteSequenceFlow(sq.getId());
}
process.deleteElementNode(tempElement.getId());
for (String target : targetIds) {
BPMNElementNode targetElement = process.findElementNodeById(target);
// probably XOR join
if (targetElement.getIngoingSequenceFlows().size() > 1) {
addXorGateway(process, targetElement);
}
splitGateway = null;
}

// }
}

}
Expand Down

0 comments on commit 276cbb0

Please sign in to comment.