use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.
the class OutputClauseUnaryTestsPropertyConverterTest method testDMNFromWBWhenNonNullWithNonEmptyString.
@Test
public void testDMNFromWBWhenNonNullWithNonEmptyString() {
final OutputClauseUnaryTests wb = new OutputClauseUnaryTests();
wb.getText().setValue(TEXT);
final JSITUnaryTests dmn = OutputClauseUnaryTestsPropertyConverter.dmnFromWB(wb);
assertThat(dmn).isNotNull();
verify(jsitUnaryTests).setText(TEXT);
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.
the class OutputClauseUnaryTestsPropertyConverterTest method testDMNFromWBWhenNonNullWithEmptyString.
@Test
public void testDMNFromWBWhenNonNullWithEmptyString() {
final OutputClauseUnaryTests wb = new OutputClauseUnaryTests();
wb.getText().setValue("");
final JSITUnaryTests dmn = OutputClauseUnaryTestsPropertyConverter.dmnFromWB(wb);
assertThat(dmn).isNull();
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.
the class OutputClauseUnaryTestsPropertyConverterTest method testDMNFromWBWhenTextIsNull.
@Test
public void testDMNFromWBWhenTextIsNull() {
final OutputClauseUnaryTests wb = new OutputClauseUnaryTests();
wb.setText(null);
final JSITUnaryTests dmn = OutputClauseUnaryTestsPropertyConverter.dmnFromWB(wb);
assertThat(dmn).isNull();
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.
the class InputClausePropertyConverter method dmnFromWB.
public static JSITInputClause dmnFromWB(final InputClause wb) {
final JSITInputClause result = new JSITInputClause();
result.setId(wb.getId().getValue());
final Optional<String> description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription()));
description.ifPresent(result::setDescription);
final JSITLiteralExpression expression = LiteralExpressionPropertyConverter.dmnFromWB(wb.getInputExpression());
final JSITUnaryTests inputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getInputValues());
result.setInputExpression(expression);
if (Objects.nonNull(inputValues) && StringUtils.nonEmpty(inputValues.getText())) {
result.setInputValues(inputValues);
}
return result;
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITUnaryTests in project kie-wb-common by kiegroup.
the class ItemDefinitionPropertyConverter method setUnaryTests.
static void setUnaryTests(final ItemDefinition wb, final JSITItemDefinition dmn) {
final JSITUnaryTests dmnAllowedValues = dmn.getAllowedValues();
final Optional<UnaryTests> wbUnaryTests = ofNullable(UnaryTestsPropertyConverter.wbFromDMN(dmnAllowedValues));
wbUnaryTests.ifPresent(unaryTests -> {
wb.setAllowedValues(unaryTests);
unaryTests.setParent(wb);
});
}
Aggregations