use of org.kie.dmn.model.api.Association in project drools by kiegroup.
the class AssociationConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Association a = (Association) parent;
writeChildrenNode(writer, context, a.getSourceRef(), SOURCE_REF);
writeChildrenNode(writer, context, a.getTargetRef(), TARGET_REF);
}
use of org.kie.dmn.model.api.Association in project drools by kiegroup.
the class DefinitionsConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Definitions def = (Definitions) parent;
for (Import i : def.getImport()) {
writeChildrenNode(writer, context, i, IMPORT);
}
for (ItemDefinition id : def.getItemDefinition()) {
writeChildrenNode(writer, context, id, ITEM_DEFINITION);
}
for (DRGElement e : def.getDrgElement()) {
String nodeName = DRG_ELEMENT;
if (e instanceof BusinessKnowledgeModel) {
nodeName = "businessKnowledgeModel";
} else if (e instanceof Decision) {
nodeName = "decision";
} else if (e instanceof InputData) {
nodeName = "inputData";
} else if (e instanceof KnowledgeSource) {
nodeName = "knowledgeSource";
} else if (e instanceof DecisionService) {
nodeName = "decisionService";
}
writeChildrenNode(writer, context, e, nodeName);
}
for (Artifact a : def.getArtifact()) {
String nodeName = ARTIFACT;
if (a instanceof Association) {
nodeName = "association";
} else if (a instanceof TextAnnotation) {
nodeName = "textAnnotation";
} else if (a instanceof Group) {
nodeName = "group";
}
writeChildrenNode(writer, context, a, nodeName);
}
for (ElementCollection ec : def.getElementCollection()) {
writeChildrenNode(writer, context, ec, ELEMENT_COLLECTION);
}
for (BusinessContextElement bce : def.getBusinessContextElement()) {
String nodeName = BUSINESS_CONTEXT_ELEMENT;
if (bce instanceof OrganizationUnit) {
nodeName = "organizationUnit";
} else if (bce instanceof PerformanceIndicator) {
nodeName = "performanceIndicator";
}
writeChildrenNode(writer, context, bce, nodeName);
}
if (def.getDMNDI() != null) {
writeChildrenNode(writer, context, def.getDMNDI(), "DMNDI");
}
}
use of org.kie.dmn.model.api.Association in project drools by kiegroup.
the class AssociationConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Association a = (Association) parent;
writeChildrenNode(writer, context, a.getSourceRef(), SOURCE_REF);
writeChildrenNode(writer, context, a.getTargetRef(), TARGET_REF);
}
use of org.kie.dmn.model.api.Association in project drools by kiegroup.
the class AssociationConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
Association a = (Association) parent;
String associationDirectionValue = reader.getAttribute(ASSOCIATION_DIRECTION);
if (associationDirectionValue != null)
a.setAssociationDirection(AssociationDirection.fromValue(associationDirectionValue));
}
use of org.kie.dmn.model.api.Association in project drools by kiegroup.
the class AssociationConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
Association a = (Association) parent;
if (a.getAssociationDirection() != null)
writer.addAttribute(ASSOCIATION_DIRECTION, a.getAssociationDirection().value());
}
Aggregations