use of org.kie.dmn.model.v1_2.TUnaryTests in project drools by kiegroup.
the class DTSheetListener method newCell.
@Override
public void newCell(int row, int column, String value, int mergedColStart) {
if (row == 0) {
// TODO row 0 being the header.
return;
}
if (curRule == null) {
return;
}
if (value == null || value.isEmpty()) {
LOG.trace("ignoring row {}, col {} having value {}", row, column, value);
return;
}
if (column < headerInfo.gethIndex()) {
valueCheck(row, column, value);
UnaryTests ut = new TUnaryTests();
ut.setText(eValue(value));
curRule.getInputEntry().add(ut);
} else if (column == headerInfo.gethIndex()) {
valueCheck(row, column, value);
LiteralExpression le = new TLiteralExpression();
le.setText(eValue(value));
curRule.getOutputEntry().add(le);
} else {
LOG.trace("ignoring row {}, col {} having value {}", row, column, value);
}
}
use of org.kie.dmn.model.v1_2.TUnaryTests 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