Search in sources :

Example 6 with UnaryTests

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

the class DecisionRuleConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    DecisionRule dr = (DecisionRule) parent;
    for (UnaryTests ie : dr.getInputEntry()) {
        writeChildrenNode(writer, context, ie, INPUT_ENTRY);
    }
    for (LiteralExpression oe : dr.getOutputEntry()) {
        writeChildrenNode(writer, context, oe, OUTPUT_ENTRY);
    }
    for (RuleAnnotation a : dr.getAnnotationEntry()) {
        writeChildrenNode(writer, context, a, ANNOTATION_ENTRY);
    }
}
Also used : RuleAnnotation(org.kie.dmn.model.api.RuleAnnotation) LiteralExpression(org.kie.dmn.model.api.LiteralExpression) UnaryTests(org.kie.dmn.model.api.UnaryTests) DecisionRule(org.kie.dmn.model.api.DecisionRule) TDecisionRule(org.kie.dmn.model.v1_2.TDecisionRule)

Example 7 with UnaryTests

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

the class UnaryTestsConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    UnaryTests ut = (UnaryTests) parent;
    writeChildrenNode(writer, context, ut.getText(), TEXT);
}
Also used : TUnaryTests(org.kie.dmn.model.v1_2.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 8 with UnaryTests

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

the class UnaryTestsConverter method writeAttributes.

@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
    super.writeAttributes(writer, parent);
    UnaryTests ut = (UnaryTests) parent;
    if (ut.getExpressionLanguage() != null)
        writer.addAttribute(EXPRESSION_LANGUAGE, ut.getExpressionLanguage());
}
Also used : TUnaryTests(org.kie.dmn.model.v1_2.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 9 with UnaryTests

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

the class UnaryTestsConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    UnaryTests ut = (UnaryTests) parent;
    String expressionLanguage = reader.getAttribute(EXPRESSION_LANGUAGE);
    ut.setExpressionLanguage(expressionLanguage);
}
Also used : TUnaryTests(org.kie.dmn.model.v1_4.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 10 with UnaryTests

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

the class ExpressionConverter method writeAttributes.

@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
    super.writeAttributes(writer, parent);
    Expression e = (Expression) parent;
    if (!(e instanceof UnaryTests) && e.getTypeRef() != null) {
        writer.addAttribute(TYPE_REF, MarshallingUtils.formatQName(e.getTypeRef(), e));
    }
}
Also used : Expression(org.kie.dmn.model.api.Expression) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Aggregations

UnaryTests (org.kie.dmn.model.api.UnaryTests)27 LiteralExpression (org.kie.dmn.model.api.LiteralExpression)9 DecisionRule (org.kie.dmn.model.api.DecisionRule)5 TUnaryTests (org.kie.dmn.model.v1_2.TUnaryTests)5 Expression (org.kie.dmn.model.api.Expression)4 RuleAnnotation (org.kie.dmn.model.api.RuleAnnotation)3 TUnaryTests (org.kie.dmn.model.v1_1.TUnaryTests)3 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 List (java.util.List)2 Entry (java.util.Map.Entry)2 Optional (java.util.Optional)2 UUID (java.util.UUID)2 Collectors (java.util.stream.Collectors)2 QName (javax.xml.namespace.QName)2 Resource (org.kie.api.io.Resource)2 DMNMessage (org.kie.dmn.api.core.DMNMessage)2 DMNType (org.kie.dmn.api.core.DMNType)2 TUnaryTests (org.kie.dmn.model.v1_3.TUnaryTests)2 TUnaryTests (org.kie.dmn.model.v1_4.TUnaryTests)2