Search in sources :

Example 21 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_4.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 22 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_4.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 23 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_3.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 24 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_3.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Example 25 with UnaryTests

use of org.kie.dmn.model.api.UnaryTests in project kie-wb-common by kiegroup.

the class DecisionRulePropertyConverterTest method testWbFromDMN.

@Test
public void testWbFromDMN() {
    final UnaryTests inputEntry = new TUnaryTests();
    final LiteralExpression outputEntry = new TLiteralExpression();
    final org.kie.dmn.model.api.DecisionRule dmn = new TDecisionRule();
    dmn.setId(ID);
    dmn.setDescription(DESCRIPTION);
    dmn.getInputEntry().add(inputEntry);
    dmn.getOutputEntry().add(outputEntry);
    final org.kie.workbench.common.dmn.api.definition.model.DecisionRule wb = DecisionRulePropertyConverter.wbFromDMN(dmn);
    assertEquals(ID, wb.getId().getValue());
    assertEquals("", wb.getDescription().getValue());
    assertEquals(wb, wb.getInputEntry().get(0).getParent());
    assertEquals(wb, wb.getOutputEntry().get(0).getParent());
    assertEquals(1, wb.getAnnotationEntry().size());
    assertEquals(DESCRIPTION, wb.getAnnotationEntry().get(0).getText().getValue());
}
Also used : TLiteralExpression(org.kie.dmn.model.v1_2.TLiteralExpression) LiteralExpression(org.kie.dmn.model.api.LiteralExpression) TLiteralExpression(org.kie.dmn.model.v1_2.TLiteralExpression) TUnaryTests(org.kie.dmn.model.v1_2.TUnaryTests) TDecisionRule(org.kie.dmn.model.v1_2.TDecisionRule) TUnaryTests(org.kie.dmn.model.v1_2.TUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests) Test(org.junit.Test)

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