Search in sources :

Example 1 with DMNDI

use of org.kie.dmn.model.api.dmndi.DMNDI in project drools by kiegroup.

the class DefinitionsConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    Definitions def = (Definitions) parent;
    if (IMPORT.equals(nodeName)) {
        def.getImport().add((Import) child);
    } else if (ITEM_DEFINITION.equals(nodeName)) {
        def.getItemDefinition().add((ItemDefinition) child);
    } else if (child instanceof DRGElement) {
        def.getDrgElement().add((DRGElement) child);
    } else if (child instanceof Artifact) {
        def.getArtifact().add((Artifact) child);
    } else if (ELEMENT_COLLECTION.equals(nodeName)) {
        def.getElementCollection().add((ElementCollection) child);
    } else if (child instanceof BusinessContextElement) {
        def.getBusinessContextElement().add((BusinessContextElement) child);
    } else if (child instanceof DMNDI) {
        DMNDI dmndi = (DMNDI) child;
        dmndi.normalize();
        def.setDMNDI(dmndi);
    } else {
        super.assignChildElement(def, nodeName, child);
    }
}
Also used : TDefinitions(org.kie.dmn.model.v1_2.TDefinitions) Definitions(org.kie.dmn.model.api.Definitions) ItemDefinition(org.kie.dmn.model.api.ItemDefinition) DMNDI(org.kie.dmn.model.api.dmndi.DMNDI) BusinessContextElement(org.kie.dmn.model.api.BusinessContextElement) Artifact(org.kie.dmn.model.api.Artifact) DRGElement(org.kie.dmn.model.api.DRGElement)

Example 2 with DMNDI

use of org.kie.dmn.model.api.dmndi.DMNDI in project drools by kiegroup.

the class DefinitionsConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    Definitions def = (Definitions) parent;
    if (IMPORT.equals(nodeName)) {
        def.getImport().add((Import) child);
    } else if (ITEM_DEFINITION.equals(nodeName)) {
        def.getItemDefinition().add((ItemDefinition) child);
    } else if (child instanceof DRGElement) {
        def.getDrgElement().add((DRGElement) child);
    } else if (child instanceof Artifact) {
        def.getArtifact().add((Artifact) child);
    } else if (ELEMENT_COLLECTION.equals(nodeName)) {
        def.getElementCollection().add((ElementCollection) child);
    } else if (child instanceof BusinessContextElement) {
        def.getBusinessContextElement().add((BusinessContextElement) child);
    } else if (child instanceof DMNDI) {
        DMNDI dmndi = (DMNDI) child;
        dmndi.normalize();
        def.setDMNDI(dmndi);
    } else {
        super.assignChildElement(def, nodeName, child);
    }
}
Also used : TDefinitions(org.kie.dmn.model.v1_4.TDefinitions) Definitions(org.kie.dmn.model.api.Definitions) ItemDefinition(org.kie.dmn.model.api.ItemDefinition) DMNDI(org.kie.dmn.model.api.dmndi.DMNDI) BusinessContextElement(org.kie.dmn.model.api.BusinessContextElement) Artifact(org.kie.dmn.model.api.Artifact) DRGElement(org.kie.dmn.model.api.DRGElement)

Example 3 with DMNDI

use of org.kie.dmn.model.api.dmndi.DMNDI in project drools by kiegroup.

the class DMNDIConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    DMNDI list = (DMNDI) parent;
    for (DMNDiagram e : list.getDMNDiagram()) {
        writeChildrenNode(writer, context, e, DMN_DIAGRAM);
    }
    for (DMNStyle e : list.getDMNStyle()) {
        writeChildrenNode(writer, context, e, DMN_STYLE);
    }
}
Also used : DMNDiagram(org.kie.dmn.model.api.dmndi.DMNDiagram) DMNDI(org.kie.dmn.model.api.dmndi.DMNDI) DMNStyle(org.kie.dmn.model.api.dmndi.DMNStyle)

Example 4 with DMNDI

use of org.kie.dmn.model.api.dmndi.DMNDI in project drools by kiegroup.

the class DefinitionsConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    Definitions def = (Definitions) parent;
    if (IMPORT.equals(nodeName)) {
        def.getImport().add((Import) child);
    } else if (ITEM_DEFINITION.equals(nodeName)) {
        def.getItemDefinition().add((ItemDefinition) child);
    } else if (child instanceof DRGElement) {
        def.getDrgElement().add((DRGElement) child);
    } else if (child instanceof Artifact) {
        def.getArtifact().add((Artifact) child);
    } else if (ELEMENT_COLLECTION.equals(nodeName)) {
        def.getElementCollection().add((ElementCollection) child);
    } else if (child instanceof BusinessContextElement) {
        def.getBusinessContextElement().add((BusinessContextElement) child);
    } else if (child instanceof DMNDI) {
        DMNDI dmndi = (DMNDI) child;
        dmndi.normalize();
        def.setDMNDI(dmndi);
    } else {
        super.assignChildElement(def, nodeName, child);
    }
}
Also used : Definitions(org.kie.dmn.model.api.Definitions) TDefinitions(org.kie.dmn.model.v1_3.TDefinitions) ItemDefinition(org.kie.dmn.model.api.ItemDefinition) DMNDI(org.kie.dmn.model.api.dmndi.DMNDI) BusinessContextElement(org.kie.dmn.model.api.BusinessContextElement) Artifact(org.kie.dmn.model.api.Artifact) DRGElement(org.kie.dmn.model.api.DRGElement)

Example 5 with DMNDI

use of org.kie.dmn.model.api.dmndi.DMNDI in project drools by kiegroup.

the class DMNDIConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    DMNDI list = (DMNDI) parent;
    for (DMNDiagram e : list.getDMNDiagram()) {
        writeChildrenNode(writer, context, e, DMN_DIAGRAM);
    }
    for (DMNStyle e : list.getDMNStyle()) {
        writeChildrenNode(writer, context, e, DMN_STYLE);
    }
}
Also used : DMNDiagram(org.kie.dmn.model.api.dmndi.DMNDiagram) DMNDI(org.kie.dmn.model.api.dmndi.DMNDI) DMNStyle(org.kie.dmn.model.api.dmndi.DMNStyle)

Aggregations

DMNDI (org.kie.dmn.model.api.dmndi.DMNDI)5 Artifact (org.kie.dmn.model.api.Artifact)3 BusinessContextElement (org.kie.dmn.model.api.BusinessContextElement)3 DRGElement (org.kie.dmn.model.api.DRGElement)3 Definitions (org.kie.dmn.model.api.Definitions)3 ItemDefinition (org.kie.dmn.model.api.ItemDefinition)3 DMNDiagram (org.kie.dmn.model.api.dmndi.DMNDiagram)2 DMNStyle (org.kie.dmn.model.api.dmndi.DMNStyle)2 TDefinitions (org.kie.dmn.model.v1_2.TDefinitions)1 TDefinitions (org.kie.dmn.model.v1_3.TDefinitions)1 TDefinitions (org.kie.dmn.model.v1_4.TDefinitions)1