Search in sources :

Example 1 with TDecisionRule

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);
}
Also used : TDecisionRule(org.kie.dmn.model.v1_2.TDecisionRule)

Example 2 with TDecisionRule

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());
}
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

TDecisionRule (org.kie.dmn.model.v1_2.TDecisionRule)2 Test (org.junit.Test)1 LiteralExpression (org.kie.dmn.model.api.LiteralExpression)1 UnaryTests (org.kie.dmn.model.api.UnaryTests)1 TLiteralExpression (org.kie.dmn.model.v1_2.TLiteralExpression)1 TUnaryTests (org.kie.dmn.model.v1_2.TUnaryTests)1