use of org.kie.workbench.common.dmn.api.property.dmn.Description in project kie-wb-common by kiegroup.
the class FunctionDefinitionPropertyConverter method wbFromDMN.
public static FunctionDefinition wbFromDMN(final org.kie.dmn.model.v1_1.FunctionDefinition dmn) {
if (dmn == null) {
return null;
}
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression());
FunctionDefinition result = new FunctionDefinition(id, description, typeRef, expression);
result.getNsContext().putAll(dmn.getNsContext());
for (Entry<javax.xml.namespace.QName, String> kv : dmn.getAdditionalAttributes().entrySet()) {
QName convertedQName = QNamePropertyConverter.wbFromDMN(kv.getKey());
result.getAdditionalAttributes().put(convertedQName, kv.getValue());
}
for (org.kie.dmn.model.v1_1.InformationItem ii : dmn.getFormalParameter()) {
InformationItem iiConverted = InformationItemPropertyConverter.wbFromDMN(ii);
result.getFormalParameter().add(iiConverted);
}
return result;
}
use of org.kie.workbench.common.dmn.api.property.dmn.Description in project kie-wb-common by kiegroup.
the class InformationItemPropertyConverter method wbFromDMN.
public static InformationItem wbFromDMN(final org.kie.dmn.model.v1_1.InformationItem dmn) {
if (dmn == null) {
return null;
}
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
Name name = new Name(dmn.getName());
QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
InformationItem result = new InformationItem(id, description, name, typeRef);
return result;
}
use of org.kie.workbench.common.dmn.api.property.dmn.Description in project kie-wb-common by kiegroup.
the class InputDataConverter method nodeFromDMN.
@Override
public Node<View<InputData>, ?> nodeFromDMN(final org.kie.dmn.model.v1_1.InputData dmn) {
@SuppressWarnings("unchecked") Node<View<InputData>, ?> node = (Node<View<InputData>, ?>) factoryManager.newElement(dmn.getId(), InputData.class).asNode();
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
Name name = new Name(dmn.getName());
InformationItem informationItem = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable());
InputData inputData = new InputData(id, description, name, informationItem, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet());
node.getContent().setDefinition(inputData);
return node;
}
use of org.kie.workbench.common.dmn.api.property.dmn.Description in project kie-wb-common by kiegroup.
the class KnowledgeSourceConverter method nodeFromDMN.
@Override
public Node<View<KnowledgeSource>, ?> nodeFromDMN(final org.kie.dmn.model.v1_1.KnowledgeSource dmn) {
@SuppressWarnings("unchecked") Node<View<KnowledgeSource>, ?> node = (Node<View<KnowledgeSource>, ?>) factoryManager.newElement(dmn.getId(), KnowledgeSource.class).asNode();
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
Name name = new Name(dmn.getName());
KnowledgeSourceType ksType = new KnowledgeSourceType(dmn.getType());
LocationURI locationURI = new LocationURI(dmn.getLocationURI());
KnowledgeSource ks = new KnowledgeSource(id, description, name, ksType, locationURI, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet());
node.getContent().setDefinition(ks);
return node;
}
use of org.kie.workbench.common.dmn.api.property.dmn.Description in project kie-wb-common by kiegroup.
the class LiteralExpressionPropertyConverter method wbFromDMN.
public static LiteralExpression wbFromDMN(final org.kie.dmn.model.v1_1.LiteralExpression dmn) {
if (dmn == null) {
return null;
}
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
String text = dmn.getText();
String expressionLanguage = dmn.getExpressionLanguage();
ImportedValues importedValues = ImportedValuesConverter.wbFromDMN(dmn.getImportedValues());
LiteralExpression result = new LiteralExpression(id, description, typeRef, text, importedValues, expressionLanguage);
return result;
}
Aggregations