Search in sources :

Example 1 with DMNElementReference

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

the class PerformanceIndicatorConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    PerformanceIndicator pi = (PerformanceIndicator) parent;
    for (DMNElementReference id : pi.getImpactingDecision()) {
        writeChildrenNode(writer, context, id, IMPACTING_DECISION);
    }
}
Also used : PerformanceIndicator(org.kie.dmn.model.v1_1.PerformanceIndicator) DMNElementReference(org.kie.dmn.model.v1_1.DMNElementReference)

Example 2 with DMNElementReference

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

the class DMNElementReferenceConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    DMNElementReference er = (DMNElementReference) parent;
    String href = reader.getAttribute(HREF);
    er.setHref(href);
}
Also used : DMNElementReference(org.kie.dmn.model.v1_1.DMNElementReference)

Example 3 with DMNElementReference

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

the class OrganizationUnitConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    OrganizationUnit ou = (OrganizationUnit) parent;
    for (DMNElementReference dm : ou.getDecisionMade()) {
        writeChildrenNode(writer, context, dm, DECISION_MADE);
    }
    for (DMNElementReference downed : ou.getDecisionOwned()) {
        writeChildrenNode(writer, context, downed, DECISION_OWNED);
    }
}
Also used : DMNElementReference(org.kie.dmn.model.v1_1.DMNElementReference) OrganizationUnit(org.kie.dmn.model.v1_1.OrganizationUnit)

Example 4 with DMNElementReference

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

the class DMNElementReferenceConverter method writeAttributes.

@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
    super.writeAttributes(writer, parent);
    DMNElementReference er = (DMNElementReference) parent;
    if (er.getHref() != null)
        writer.addAttribute(HREF, er.getHref());
}
Also used : DMNElementReference(org.kie.dmn.model.v1_1.DMNElementReference)

Example 5 with DMNElementReference

use of org.kie.dmn.model.v1_1.DMNElementReference 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 DMNElementReference();
            ref.setHref(reader.getAttribute("href"));
            object = ref;
        } else {
            // Default behaviour
            object = readItem(reader, context, null);
        }
        if (object instanceof DMNModelInstrumentedBase) {
            ((DMNModelInstrumentedBase) object).setParent((DMNModelInstrumentedBase) parent);
            ((DMNModelInstrumentedBase) parent).addChildren((DMNModelInstrumentedBase) object);
        }
        reader.moveUp();
        assignChildElement(parent, nodeName, object);
    }
}
Also used : DMNElementReference(org.kie.dmn.model.v1_1.DMNElementReference) DMNModelInstrumentedBase(org.kie.dmn.model.v1_1.DMNModelInstrumentedBase)

Aggregations

DMNElementReference (org.kie.dmn.model.v1_1.DMNElementReference)7 ElementCollection (org.kie.dmn.model.v1_1.ElementCollection)2 DMNModelInstrumentedBase (org.kie.dmn.model.v1_1.DMNModelInstrumentedBase)1 DecisionService (org.kie.dmn.model.v1_1.DecisionService)1 OrganizationUnit (org.kie.dmn.model.v1_1.OrganizationUnit)1 PerformanceIndicator (org.kie.dmn.model.v1_1.PerformanceIndicator)1