use of org.kie.dmn.model.v1_3.TDecisionRule in project drools by kiegroup.
the class DTSheetListener method newRow.
@Override
public void newRow(int rowNumber, int columns) {
if (rowNumber == 0) {
// TODO row 0 being the header.
return;
}
if (columns == -1) {
curRule = null;
return;
}
if (columns < dt.getInput().size() + dt.getOutput().size()) {
throw new XLS2DMNException("In row " + rowNumber + " only total of cells is: " + columns);
}
curRule = new TDecisionRule();
dt.getRule().add(curRule);
}
use of org.kie.dmn.model.v1_3.TDecisionRule 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