Search in sources :

Example 31 with LiteralExpression

use of org.kie.dmn.model.api.LiteralExpression 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;
}
Also used : LiteralExpression(org.kie.dmn.model.api.LiteralExpression) OutputClauseLiteralExpression(org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression) OutputClauseUnaryTests(org.kie.workbench.common.dmn.api.definition.model.OutputClauseUnaryTests) UnaryTests(org.kie.dmn.model.api.UnaryTests)

Aggregations

LiteralExpression (org.kie.dmn.model.api.LiteralExpression)31 UnaryTests (org.kie.dmn.model.api.UnaryTests)11 DecisionRule (org.kie.dmn.model.api.DecisionRule)9 TLiteralExpression (org.kie.dmn.model.v1_2.TLiteralExpression)8 InputClause (org.kie.dmn.model.api.InputClause)6 ArrayList (java.util.ArrayList)5 QName (javax.xml.namespace.QName)5 InformationItem (org.kie.dmn.model.api.InformationItem)5 Collections (java.util.Collections)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 Test (org.junit.Test)4 DMNMessage (org.kie.dmn.api.core.DMNMessage)4 DMNType (org.kie.dmn.api.core.DMNType)4 DMNNode (org.kie.dmn.api.core.ast.DMNNode)4 DMNExpressionEvaluator (org.kie.dmn.core.api.DMNExpressionEvaluator)4 Decision (org.kie.dmn.model.api.Decision)4 DecisionTable (org.kie.dmn.model.api.DecisionTable)4 Entry (java.util.Map.Entry)3 Objects (java.util.Objects)3