Search in sources :

Example 21 with Description

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

the class InvocationPropertyConverter method wbFromDMN.

public static Invocation wbFromDMN(final org.kie.dmn.model.v1_1.Invocation dmn) {
    if (dmn == null) {
        return null;
    }
    Id id = new Id(dmn.getId());
    Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
    QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
    Invocation result = new Invocation();
    result.setId(id);
    result.setDescription(description);
    result.setTypeRef(typeRef);
    Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression());
    result.setExpression(convertedExpression);
    for (org.kie.dmn.model.v1_1.Binding b : dmn.getBinding()) {
        Binding bConverted = BindingPropertyConverter.wbFromDMN(b);
        result.getBinding().add(bConverted);
    }
    return result;
}
Also used : Binding(org.kie.workbench.common.dmn.api.definition.v1_1.Binding) Description(org.kie.workbench.common.dmn.api.property.dmn.Description) Invocation(org.kie.workbench.common.dmn.api.definition.v1_1.Invocation) Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Id(org.kie.workbench.common.dmn.api.property.dmn.Id)

Example 22 with Description

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

the class ItemDefinitionPropertyConverter method wbFromDMN.

public static ItemDefinition wbFromDMN(final org.kie.dmn.model.v1_1.ItemDefinition dmn) {
    if (dmn == null) {
        return null;
    }
    Id id = new Id(dmn.getId());
    Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
    QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
    Name name = new Name(dmn.getName());
    ItemDefinition result = new ItemDefinition();
    result.setId(id);
    result.setName(name);
    result.setDescription(description);
    result.setTypeRef(typeRef);
    result.setTypeLanguage(dmn.getTypeLanguage());
    result.setIsCollection(dmn.isIsCollection());
    UnaryTests utConverted = UnaryTestsPropertyConverter.wbFromDMN(dmn.getAllowedValues());
    result.setAllowedValues(utConverted);
    for (org.kie.dmn.model.v1_1.ItemDefinition child : dmn.getItemComponent()) {
        ItemDefinition convertedChild = ItemDefinitionPropertyConverter.wbFromDMN(child);
        result.getItemComponent().add(convertedChild);
    }
    return result;
}
Also used : Description(org.kie.workbench.common.dmn.api.property.dmn.Description) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ItemDefinition(org.kie.workbench.common.dmn.api.definition.v1_1.ItemDefinition) Id(org.kie.workbench.common.dmn.api.property.dmn.Id) UnaryTests(org.kie.workbench.common.dmn.api.definition.v1_1.UnaryTests) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name)

Example 23 with Description

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

the class ListPropertyConverter method wbFromDMN.

public static List wbFromDMN(final org.kie.dmn.model.v1_1.List dmn) {
    Id id = new Id(dmn.getId());
    Description description = new Description(dmn.getDescription());
    QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
    java.util.List<Expression> expression = new ArrayList<>();
    for (org.kie.dmn.model.v1_1.Expression e : dmn.getExpression()) {
        Expression eConverted = ExpressionPropertyConverter.wbFromDMN(e);
        expression.add(eConverted);
    }
    List result = new List(id, description, typeRef, expression);
    return result;
}
Also used : Description(org.kie.workbench.common.dmn.api.property.dmn.Description) Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ArrayList(java.util.ArrayList) List(org.kie.workbench.common.dmn.api.definition.v1_1.List) ArrayList(java.util.ArrayList) Id(org.kie.workbench.common.dmn.api.property.dmn.Id)

Aggregations

Description (org.kie.workbench.common.dmn.api.property.dmn.Description)23 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)20 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)10 UnaryTests (org.kie.workbench.common.dmn.api.definition.v1_1.UnaryTests)7 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)7 InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)6 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)6 BackgroundSet (org.kie.workbench.common.dmn.api.property.background.BackgroundSet)6 RectangleDimensionsSet (org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet)6 FontSet (org.kie.workbench.common.dmn.api.property.font.FontSet)6 Node (org.kie.workbench.common.stunner.core.graph.Node)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)6 Expression (org.kie.workbench.common.dmn.api.definition.v1_1.Expression)4 DecisionRule (org.kie.workbench.common.dmn.api.definition.v1_1.DecisionRule)3 InputClause (org.kie.workbench.common.dmn.api.definition.v1_1.InputClause)3 OutputClause (org.kie.workbench.common.dmn.api.definition.v1_1.OutputClause)3 List (java.util.List)2 Optional (java.util.Optional)2 BusinessKnowledgeModel (org.kie.workbench.common.dmn.api.definition.v1_1.BusinessKnowledgeModel)2 Decision (org.kie.workbench.common.dmn.api.definition.v1_1.Decision)2