use of org.kie.dmn.model.api.LiteralExpression 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);
}
}
use of org.kie.dmn.model.api.LiteralExpression in project drools by kiegroup.
the class LiteralExpressionConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
LiteralExpression le = (LiteralExpression) parent;
if (le.getText() != null)
writeChildrenNodeAsValue(writer, context, le.getText(), TEXT);
if (le.getImportedValues() != null)
writeChildrenNode(writer, context, le.getImportedValues(), IMPORTED_VALUES);
}
use of org.kie.dmn.model.api.LiteralExpression in project drools by kiegroup.
the class LiteralExpressionConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
LiteralExpression le = (LiteralExpression) parent;
String exprLanguage = reader.getAttribute(EXPR_LANGUAGE);
le.setExpressionLanguage(exprLanguage);
}
use of org.kie.dmn.model.api.LiteralExpression in project drools by kiegroup.
the class LiteralExpressionConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
LiteralExpression le = (LiteralExpression) parent;
if (le.getExpressionLanguage() != null)
writer.addAttribute(EXPR_LANGUAGE, le.getExpressionLanguage());
}
use of org.kie.dmn.model.api.LiteralExpression 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());
}
Aggregations