use of org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression in project kie-wb-common by kiegroup.
the class OutputClauseLiteralExpressionPropertyConverter method wbFromDMN.
public static OutputClauseLiteralExpression wbFromDMN(final org.kie.dmn.model.api.LiteralExpression dmn) {
if (dmn == null) {
return null;
}
final Id id = new Id(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn);
final Text text = new Text(dmn.getText());
final ImportedValues importedValues = ImportedValuesConverter.wbFromDMN(dmn.getImportedValues());
final OutputClauseLiteralExpression result = new OutputClauseLiteralExpression(id, description, typeRef, text, importedValues);
if (importedValues != null) {
importedValues.setParent(result);
}
return result;
}
use of org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression in project kie-wb-common by kiegroup.
the class OutputClausePropertyConverter method wbFromDMN.
public static OutputClause wbFromDMN(final org.kie.dmn.model.api.OutputClause dmn) {
final Id id = new Id(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final OutputClauseUnaryTests outputValues = OutputClauseUnaryTestsPropertyConverter.wbFromDMN(dmn.getOutputValues());
final OutputClauseLiteralExpression defaultOutputEntry = OutputClauseLiteralExpressionPropertyConverter.wbFromDMN(dmn.getDefaultOutputEntry());
final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef(), dmn);
final OutputClause result = new OutputClause();
result.setId(id);
result.setName(dmn.getName());
result.setDescription(description);
result.setOutputValues(outputValues);
result.setDefaultOutputEntry(defaultOutputEntry);
result.setTypeRef(typeRef);
if (outputValues != null) {
outputValues.setParent(result);
}
if (defaultOutputEntry != null) {
defaultOutputEntry.setParent(result);
}
return result;
}
use of org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression in project kie-wb-common by kiegroup.
the class OutputClauseLiteralExpressionPropertyConverterTest method testWBFromDMNWhenNonNull.
@Test
public void testWBFromDMNWhenNonNull() {
when(jsitLiteralExpression.getText()).thenReturn(TEXT);
final OutputClauseLiteralExpression wb = OutputClauseLiteralExpressionPropertyConverter.wbFromDMN(jsitLiteralExpression);
assertThat(wb).isNotNull();
assertThat(wb.getText().getValue()).isEqualTo(TEXT);
}
use of org.kie.workbench.common.dmn.api.definition.model.OutputClauseLiteralExpression in project kie-wb-common by kiegroup.
the class OutputClauseLiteralExpressionPropertyConverterTest method testWBFromDMNWhenNull.
@Test
public void testWBFromDMNWhenNull() {
final OutputClauseLiteralExpression wb = OutputClauseLiteralExpressionPropertyConverter.wbFromDMN(null);
assertThat(wb).isNotNull();
}
Aggregations