Search in sources :

Example 6 with RuleAnnotation

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

the class RuleAnnotationConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    super.assignChildElement(parent, nodeName, child);
    RuleAnnotation e = (RuleAnnotation) parent;
    if (TEXT.equals(nodeName)) {
        e.setText((String) child);
    } else {
        super.assignChildElement(parent, nodeName, child);
    }
}
Also used : RuleAnnotation(org.kie.dmn.model.api.RuleAnnotation) TRuleAnnotation(org.kie.dmn.model.v1_2.TRuleAnnotation)

Example 7 with RuleAnnotation

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

the class RuleAnnotationConverter method writeChildren.

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

Example 8 with RuleAnnotation

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

the class RuleAnnotationConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    super.assignChildElement(parent, nodeName, child);
    RuleAnnotation e = (RuleAnnotation) parent;
    if (TEXT.equals(nodeName)) {
        e.setText((String) child);
    } else {
        super.assignChildElement(parent, nodeName, child);
    }
}
Also used : TRuleAnnotation(org.kie.dmn.model.v1_4.TRuleAnnotation) RuleAnnotation(org.kie.dmn.model.api.RuleAnnotation)

Example 9 with RuleAnnotation

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

the class RuleAnnotationConverter method assignChildElement.

@Override
protected void assignChildElement(Object parent, String nodeName, Object child) {
    super.assignChildElement(parent, nodeName, child);
    RuleAnnotation e = (RuleAnnotation) parent;
    if (TEXT.equals(nodeName)) {
        e.setText((String) child);
    } else {
        super.assignChildElement(parent, nodeName, child);
    }
}
Also used : RuleAnnotation(org.kie.dmn.model.api.RuleAnnotation) TRuleAnnotation(org.kie.dmn.model.v1_3.TRuleAnnotation)

Example 10 with RuleAnnotation

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

the class RuleAnnotationClauseTextConverterTest method testDmnFromWB.

@Test
public void testDmnFromWB() {
    final String text = "text";
    final Text textObject = new Text(text);
    when(ruleAnnotationClauseText.getText()).thenReturn(textObject);
    final RuleAnnotation converted = RuleAnnotationClauseTextConverter.dmnFromWB(ruleAnnotationClauseText);
    assertEquals(text, converted.getText());
}
Also used : RuleAnnotation(org.kie.dmn.model.api.RuleAnnotation) Text(org.kie.workbench.common.dmn.api.property.dmn.Text) RuleAnnotationClauseText(org.kie.workbench.common.dmn.api.definition.model.RuleAnnotationClauseText) Test(org.junit.Test)

Aggregations

RuleAnnotation (org.kie.dmn.model.api.RuleAnnotation)11 DecisionRule (org.kie.dmn.model.api.DecisionRule)3 LiteralExpression (org.kie.dmn.model.api.LiteralExpression)3 UnaryTests (org.kie.dmn.model.api.UnaryTests)3 TRuleAnnotation (org.kie.dmn.model.v1_2.TRuleAnnotation)2 TRuleAnnotation (org.kie.dmn.model.v1_3.TRuleAnnotation)2 TRuleAnnotation (org.kie.dmn.model.v1_4.TRuleAnnotation)2 Test (org.junit.Test)1 TDecisionRule (org.kie.dmn.model.v1_2.TDecisionRule)1 TDecisionRule (org.kie.dmn.model.v1_3.TDecisionRule)1 TDecisionRule (org.kie.dmn.model.v1_4.TDecisionRule)1 RuleAnnotationClauseText (org.kie.workbench.common.dmn.api.definition.model.RuleAnnotationClauseText)1 Text (org.kie.workbench.common.dmn.api.property.dmn.Text)1