use of org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage in project kie-wb-common by kiegroup.
the class UnaryTestsTest method testCopy.
@Test
public void testCopy() {
final UnaryTests source = new UnaryTests(new Id(UNARY_ID), new Description(DESCRIPTION), new Text(TEXT_VALUE), new ExpressionLanguage(EXPRESSION_LANGUAGE), NONE);
final UnaryTests target = source.copy();
assertNotNull(target);
assertNotEquals(UNARY_ID, target.getId());
assertEquals(DESCRIPTION, target.getDescription().getValue());
assertEquals(TEXT_VALUE, target.getText().getValue());
assertEquals(EXPRESSION_LANGUAGE, target.getExpressionLanguage().getValue());
assertEquals(NONE, target.getConstraintType());
}
use of org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage in project kie-wb-common by kiegroup.
the class LiteralExpressionPropertyConverter method wbFromDMN.
public static LiteralExpression wbFromDMN(final JSITLiteralExpression dmn) {
if (Objects.isNull(dmn)) {
return null;
}
final Id id = IdPropertyConverter.wbFromDMN(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
final Text text = new Text(Objects.nonNull(dmn.getText()) ? dmn.getText() : "");
final ExpressionLanguage expressionLanguage = ExpressionLanguagePropertyConverter.wbFromDMN(dmn.getExpressionLanguage());
final ImportedValues importedValues = ImportedValuesConverter.wbFromDMN(dmn.getImportedValues());
final LiteralExpression result = new LiteralExpression(id, description, typeRef, text, importedValues, expressionLanguage);
if (Objects.nonNull(importedValues)) {
importedValues.setParent(result);
}
return result;
}
Aggregations