Search in sources :

Example 11 with JSITDMNElementReference

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;
}
Also used : ArrayList(java.util.ArrayList) JSITDMNElementReference(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference)

Aggregations

JSITDMNElementReference (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDMNElementReference)11 ArrayList (java.util.ArrayList)9 View (org.kie.workbench.common.stunner.core.graph.content.view.View)8 List (java.util.List)7 Edge (org.kie.workbench.common.stunner.core.graph.Edge)7 DRGElement (org.kie.workbench.common.dmn.api.definition.model.DRGElement)5 DecisionService (org.kie.workbench.common.dmn.api.definition.model.DecisionService)4 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)4 JSITDecisionService (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITDecisionService)4 Node (org.kie.workbench.common.stunner.core.graph.Node)4 DMNElementReference (org.kie.workbench.common.dmn.api.definition.model.DMNElementReference)3 Decision (org.kie.workbench.common.dmn.api.definition.model.Decision)3 InputData (org.kie.workbench.common.dmn.api.definition.model.InputData)3 KnowledgeRequirement (org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement)3 KnowledgeSource (org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource)3 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)3 JSITAuthorityRequirement (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITAuthorityRequirement)3 JSITInformationItem (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem)3 JSITKnowledgeRequirement (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITKnowledgeRequirement)3 BindableAdapterUtils.getDefinitionId (org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId)3