Search in sources :

Example 1 with LocationURI

use of org.kie.workbench.common.dmn.api.property.dmn.LocationURI in project kie-wb-common by kiegroup.

the class ImportedValuesConverter method wbFromDMN.

public static ImportedValues wbFromDMN(final org.kie.dmn.model.v1_1.ImportedValues dmn) {
    if (dmn == null) {
        return null;
    }
    String namespace = dmn.getNamespace();
    LocationURI locationURI = new LocationURI(dmn.getLocationURI());
    String importType = dmn.getImportType();
    String importedElement = dmn.getImportedElement();
    String expressionLanguage = dmn.getExpressionLanguage();
    ImportedValues wb = new ImportedValues(namespace, locationURI, importType, importedElement, expressionLanguage);
    return wb;
}
Also used : LocationURI(org.kie.workbench.common.dmn.api.property.dmn.LocationURI) ImportedValues(org.kie.workbench.common.dmn.api.definition.v1_1.ImportedValues)

Example 2 with LocationURI

use of org.kie.workbench.common.dmn.api.property.dmn.LocationURI 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;
}
Also used : LocationURI(org.kie.workbench.common.dmn.api.property.dmn.LocationURI) Description(org.kie.workbench.common.dmn.api.property.dmn.Description) KnowledgeSourceType(org.kie.workbench.common.dmn.api.property.dmn.KnowledgeSourceType) Node(org.kie.workbench.common.stunner.core.graph.Node) RectangleDimensionsSet(org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) FontSet(org.kie.workbench.common.dmn.api.property.font.FontSet) BackgroundSet(org.kie.workbench.common.dmn.api.property.background.BackgroundSet) KnowledgeSource(org.kie.workbench.common.dmn.api.definition.v1_1.KnowledgeSource) Id(org.kie.workbench.common.dmn.api.property.dmn.Id)

Aggregations

LocationURI (org.kie.workbench.common.dmn.api.property.dmn.LocationURI)2 ImportedValues (org.kie.workbench.common.dmn.api.definition.v1_1.ImportedValues)1 KnowledgeSource (org.kie.workbench.common.dmn.api.definition.v1_1.KnowledgeSource)1 BackgroundSet (org.kie.workbench.common.dmn.api.property.background.BackgroundSet)1 RectangleDimensionsSet (org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet)1 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)1 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)1 KnowledgeSourceType (org.kie.workbench.common.dmn.api.property.dmn.KnowledgeSourceType)1 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)1 FontSet (org.kie.workbench.common.dmn.api.property.font.FontSet)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1