use of org.kie.dmn.model.api.ImportedValues in project kie-wb-common by kiegroup.
the class BaseLiteralExpressionPropertyConverterTest method testDMNFromWB.
@Test
public void testDMNFromWB() {
final org.kie.workbench.common.dmn.api.definition.model.ImportedValues importedValues = new org.kie.workbench.common.dmn.api.definition.model.ImportedValues();
importedValues.setImportedElement(IMPORTED_ELEMENT);
final org.kie.workbench.common.dmn.api.definition.model.LiteralExpression wb = new org.kie.workbench.common.dmn.api.definition.model.LiteralExpression(new Id(UUID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName(), new Text(TEXT), importedValues, new ExpressionLanguage(EXPRESSION_LANGUAGE));
final LiteralExpression dmn = LiteralExpressionPropertyConverter.dmnFromWB(wb);
assertThat(dmn.getId()).isEqualTo(UUID);
assertThat(dmn.getDescription()).isEqualTo(DESCRIPTION);
assertThat(dmn.getTypeRef().getNamespaceURI()).isEmpty();
assertThat(dmn.getTypeRef().getLocalPart()).isEqualTo(BuiltInType.BOOLEAN.getName());
assertThat(dmn.getText()).isEqualTo(TEXT);
assertThat(dmn.getImportedValues()).isNotNull();
assertThat(dmn.getImportedValues().getImportedElement()).isEqualTo(IMPORTED_ELEMENT);
assertThat(dmn.getExpressionLanguage()).isEqualTo(EXPRESSION_LANGUAGE);
}
use of org.kie.dmn.model.api.ImportedValues in project kie-wb-common by kiegroup.
the class BaseLiteralExpressionPropertyConverterTest method testWBFromDMN.
@Test
public void testWBFromDMN() {
final LiteralExpression dmn = new TLiteralExpression();
final QName typeRef = new QName(KIE.getUri(), LOCAL, KIE.getPrefix());
final ImportedValues importedValues = new TImportedValues();
importedValues.setImportedElement(IMPORTED_ELEMENT);
dmn.setId(UUID);
dmn.setDescription(DESCRIPTION);
dmn.setTypeRef(typeRef);
dmn.setText(TEXT);
dmn.setImportedValues(importedValues);
final T wb = convertWBFromDMN(dmn);
assertThat(wb.getId().getValue()).isEqualTo(UUID);
assertThat(wb.getDescription().getValue()).isEqualTo(DESCRIPTION);
assertThat(wb.getTypeRef().getNamespaceURI()).isEqualTo(KIE.getUri());
assertThat(wb.getTypeRef().getLocalPart()).isEqualTo(LOCAL);
assertThat(wb.getTypeRef().getPrefix()).isEqualTo(KIE.getPrefix());
assertThat(wb.getText().getValue()).isEqualTo(TEXT);
assertThat(wb.getImportedValues().getImportedElement()).isEqualTo(IMPORTED_ELEMENT);
assertThat(wb.getImportedValues().getParent()).isEqualTo(wb);
}
use of org.kie.dmn.model.api.ImportedValues in project drools by kiegroup.
the class ImportedValuesConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
ImportedValues iv = (ImportedValues) parent;
String expressionLanguage = reader.getAttribute(EXPRESSION_LANGUAGE);
iv.setExpressionLanguage(expressionLanguage);
}
use of org.kie.dmn.model.api.ImportedValues in project drools by kiegroup.
the class ImportedValuesConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
ImportedValues iv = (ImportedValues) parent;
writeChildrenNode(writer, context, iv.getImportedElement(), IMPORTED_ELEMENT);
}
use of org.kie.dmn.model.api.ImportedValues in project drools by kiegroup.
the class ImportedValuesConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
ImportedValues iv = (ImportedValues) parent;
String expressionLanguage = reader.getAttribute(EXPRESSION_LANGUAGE);
iv.setExpressionLanguage(expressionLanguage);
}
Aggregations