use of org.kie.dmn.model.api.UnaryTests in project kie-wb-common by kiegroup.
the class InputClausePropertyConverter method dmnFromWB.
public static org.kie.dmn.model.api.InputClause dmnFromWB(final InputClause wb) {
final org.kie.dmn.model.api.InputClause result = new org.kie.dmn.model.v1_2.TInputClause();
result.setId(wb.getId().getValue());
result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription()));
final org.kie.dmn.model.api.LiteralExpression expression = LiteralExpressionPropertyConverter.dmnFromWB(wb.getInputExpression());
final UnaryTests inputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getInputValues());
if (expression != null) {
expression.setParent(result);
}
result.setInputExpression(expression);
if (inputValues != null && StringUtils.nonEmpty(inputValues.getText())) {
inputValues.setParent(result);
result.setInputValues(inputValues);
}
return result;
}
use of org.kie.dmn.model.api.UnaryTests in project kie-wb-common by kiegroup.
the class OutputClausePropertyConverter method dmnFromWB.
public static org.kie.dmn.model.api.OutputClause dmnFromWB(final OutputClause wb) {
final org.kie.dmn.model.api.OutputClause result = new org.kie.dmn.model.v1_2.TOutputClause();
result.setId(wb.getId().getValue());
result.setName(wb.getName());
result.setDescription(DescriptionPropertyConverter.dmnFromWB(wb.getDescription()));
final UnaryTests outputValues = UnaryTestsPropertyConverter.dmnFromWB(wb.getOutputValues());
if (outputValues != null && StringUtils.nonEmpty(outputValues.getText())) {
outputValues.setParent(result);
result.setOutputValues(outputValues);
}
final LiteralExpression defaultOutputEntry = LiteralExpressionPropertyConverter.dmnFromWB(wb.getDefaultOutputEntry());
if (defaultOutputEntry != null && StringUtils.nonEmpty(defaultOutputEntry.getText())) {
defaultOutputEntry.setParent(result);
result.setDefaultOutputEntry(defaultOutputEntry);
}
QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef);
return result;
}
Aggregations