Search in sources :

Example 21 with Decision

use of org.kie.dmn.model.v1_1.Decision in project drools by kiegroup.

the class DecisionServiceConverter method parseElements.

@Override
protected void parseElements(HierarchicalStreamReader reader, UnmarshallingContext context, Object parent) {
    while (reader.hasMoreChildren()) {
        reader.moveDown();
        Object object = null;
        String nodeName = reader.getNodeName();
        if (nodeName.equals(INPUT_DATA)) {
            // Patch because the tag name inputData is used in both decision services and as a DRG Element
            DMNElementReference ref = new TDMNElementReference();
            ref.setHref(reader.getAttribute("href"));
            object = ref;
        } else {
            // Default behaviour
            object = readItem(reader, context, null);
        }
        if (object instanceof DMNModelInstrumentedBase) {
            ((KieDMNModelInstrumentedBase) object).setParent((KieDMNModelInstrumentedBase) parent);
            ((KieDMNModelInstrumentedBase) parent).addChildren((KieDMNModelInstrumentedBase) object);
        }
        reader.moveUp();
        assignChildElement(parent, nodeName, object);
    }
}
Also used : DMNElementReference(org.kie.dmn.model.api.DMNElementReference) TDMNElementReference(org.kie.dmn.model.v1_1.TDMNElementReference) DMNModelInstrumentedBase(org.kie.dmn.model.api.DMNModelInstrumentedBase) KieDMNModelInstrumentedBase(org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase) TDMNElementReference(org.kie.dmn.model.v1_1.TDMNElementReference) KieDMNModelInstrumentedBase(org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase)

Aggregations

Decision (org.kie.workbench.common.dmn.api.definition.v1_1.Decision)10 InputData (org.kie.workbench.common.dmn.api.definition.v1_1.InputData)6 KnowledgeSource (org.kie.workbench.common.dmn.api.definition.v1_1.KnowledgeSource)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)6 Definitions (org.kie.dmn.model.api.Definitions)5 TDefinitions (org.kie.dmn.model.v1_1.TDefinitions)5 BusinessKnowledgeModel (org.kie.workbench.common.dmn.api.definition.v1_1.BusinessKnowledgeModel)5 List (java.util.List)4 Test (org.junit.Test)4 DMNRuntime (org.kie.dmn.api.core.DMNRuntime)4 TextAnnotation (org.kie.workbench.common.dmn.api.definition.v1_1.TextAnnotation)4 DMNShape (org.kie.workbench.common.dmn.backend.definition.v1_1.dd.DMNShape)4 XMLEncoderDiagramMetadataMarshaller (org.kie.workbench.common.stunner.core.backend.service.XMLEncoderDiagramMetadataMarshaller)4 Edge (org.kie.workbench.common.stunner.core.graph.Edge)4 DMNResult (org.kie.dmn.api.core.DMNResult)3 DecisionNode (org.kie.dmn.api.core.ast.DecisionNode)3 Decision (org.kie.dmn.model.api.Decision)3 DRGElement (org.kie.workbench.common.dmn.api.definition.v1_1.DRGElement)3 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)3 Bounds (org.kie.workbench.common.dmn.backend.definition.v1_1.dd.org.omg.spec.CMMN_20151109_DC.Bounds)3