use of org.kie.dmn.model.api.DecisionTable in project drools by kiegroup.
the class DecisionTableConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
DecisionTable dt = (DecisionTable) parent;
String hitPolicyValue = reader.getAttribute(HIT_POLICY);
String aggregationValue = reader.getAttribute(AGGREGATION);
String preferredOrientationValue = reader.getAttribute(PREFERRED_ORIENTATION);
String outputLabel = reader.getAttribute(OUTPUT_LABEL);
if (hitPolicyValue != null)
dt.setHitPolicy(HitPolicy.fromValue(hitPolicyValue));
if (aggregationValue != null)
dt.setAggregation(BuiltinAggregator.fromValue(aggregationValue));
if (preferredOrientationValue != null)
dt.setPreferredOrientation(DecisionTableOrientation.fromValue(preferredOrientationValue));
dt.setOutputLabel(outputLabel);
}
use of org.kie.dmn.model.api.DecisionTable in project drools by kiegroup.
the class DecisionTableConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
DecisionTable dt = (DecisionTable) parent;
for (InputClause i : dt.getInput()) {
writeChildrenNode(writer, context, i, INPUT);
}
for (OutputClause o : dt.getOutput()) {
writeChildrenNode(writer, context, o, OUTPUT);
}
for (DecisionRule r : dt.getRule()) {
writeChildrenNode(writer, context, r, RULE);
}
}
use of org.kie.dmn.model.api.DecisionTable in project drools by kiegroup.
the class DecisionTableConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
DecisionTable dt = (DecisionTable) parent;
if (dt.getHitPolicy() != null)
writer.addAttribute(HIT_POLICY, dt.getHitPolicy().value());
if (dt.getAggregation() != null)
writer.addAttribute(AGGREGATION, dt.getAggregation().value());
if (dt.getPreferredOrientation() != null)
writer.addAttribute(PREFERRED_ORIENTATION, dt.getPreferredOrientation().value());
if (dt.getOutputLabel() != null)
writer.addAttribute(OUTPUT_LABEL, dt.getOutputLabel());
}
use of org.kie.dmn.model.api.DecisionTable in project drools by kiegroup.
the class DecisionTableConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
DecisionTable dt = (DecisionTable) parent;
for (InputClause i : dt.getInput()) {
writeChildrenNode(writer, context, i, INPUT);
}
for (OutputClause o : dt.getOutput()) {
writeChildrenNode(writer, context, o, OUTPUT);
}
for (RuleAnnotationClause a : dt.getAnnotation()) {
writeChildrenNode(writer, context, a, ANNOTATION);
}
for (DecisionRule r : dt.getRule()) {
writeChildrenNode(writer, context, r, RULE);
}
}
use of org.kie.dmn.model.api.DecisionTable in project drools by kiegroup.
the class DecisionTableConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
DecisionTable dt = (DecisionTable) parent;
String hitPolicyValue = reader.getAttribute(HIT_POLICY);
String aggregationValue = reader.getAttribute(AGGREGATION);
String preferredOrientationValue = reader.getAttribute(PREFERRED_ORIENTATION);
String outputLabel = reader.getAttribute(OUTPUT_LABEL);
if (hitPolicyValue != null)
dt.setHitPolicy(HitPolicy.fromValue(hitPolicyValue));
if (aggregationValue != null)
dt.setAggregation(BuiltinAggregator.fromValue(aggregationValue));
if (preferredOrientationValue != null)
dt.setPreferredOrientation(DecisionTableOrientation.fromValue(preferredOrientationValue));
dt.setOutputLabel(outputLabel);
}
Aggregations