use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference in project kie-wb-common by kiegroup.
the class DecisionServiceConverter method reconcileExistingAndCandidate.
private List<JSITDMNElementReference> reconcileExistingAndCandidate(final List<JSITDMNElementReference> existingList, final List<JSITDMNElementReference> candidateList) {
final List<JSITDMNElementReference> targetList = new ArrayList<>();
final List<JSITDMNElementReference> existing = new ArrayList<>(existingList);
final List<JSITDMNElementReference> candidate = new ArrayList<>(candidateList);
for (int i = 0; i < existing.size(); i++) {
final JSITDMNElementReference e = Js.uncheckedCast(existing.get(i));
final boolean existingIsAlsoCandidate = candidate.removeIf(er -> er.getHref().equals(e.getHref()));
if (existingIsAlsoCandidate) {
targetList.add(Js.uncheckedCast(e));
}
}
for (int i = 0; i < candidate.size(); i++) {
final JSITDMNElementReference c = Js.uncheckedCast(candidate.get(i));
targetList.add(c);
}
return targetList;
}
Aggregations