Search in sources :

Example 1 with InformationItem

use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project drools by kiegroup.

the class FunctionDefinitionConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    FunctionDefinition fd = (FunctionDefinition) parent;
    for (InformationItem fparam : fd.getFormalParameter()) {
        writeChildrenNode(writer, context, fparam, FORMAL_PARAMETER);
    }
    if (fd.getExpression() != null)
        writeChildrenNode(writer, context, fd.getExpression(), MarshallingUtils.defineExpressionNodeName(fd.getExpression()));
}
Also used : FunctionDefinition(org.kie.dmn.model.v1_1.FunctionDefinition) InformationItem(org.kie.dmn.model.v1_1.InformationItem)

Example 2 with InformationItem

use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project drools by kiegroup.

the class InformationItemConverter method writeAttributes.

@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
    super.writeAttributes(writer, parent);
    InformationItem ii = (InformationItem) parent;
    if (ii.getTypeRef() != null)
        writer.addAttribute(TYPE_REF, MarshallingUtils.formatQName(ii.getTypeRef()));
}
Also used : InformationItem(org.kie.dmn.model.v1_1.InformationItem)

Example 3 with InformationItem

use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project drools by kiegroup.

the class InformationItemConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    InformationItem ii = (InformationItem) parent;
    String typeRef = reader.getAttribute(TYPE_REF);
    ii.setTypeRef(MarshallingUtils.parseQNameString(typeRef));
}
Also used : InformationItem(org.kie.dmn.model.v1_1.InformationItem)

Example 4 with InformationItem

use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.

the class BindingPropertyConverter method wbFromDMN.

public static Binding wbFromDMN(final org.kie.dmn.model.v1_1.Binding dmn) {
    if (dmn == null) {
        return null;
    }
    InformationItem convertedParameter = InformationItemPropertyConverter.wbFromDMN(dmn.getParameter());
    Expression convertedExpression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression());
    Binding result = new Binding();
    result.setParameter(convertedParameter);
    result.setExpression(convertedExpression);
    return result;
}
Also used : Binding(org.kie.workbench.common.dmn.api.definition.v1_1.Binding) Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) InformationItem(org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)

Example 5 with InformationItem

use of org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem in project kie-wb-common by kiegroup.

the class ContextEntryPropertyConverter method wbFromDMN.

public static ContextEntry wbFromDMN(final org.kie.dmn.model.v1_1.ContextEntry dmn) {
    InformationItem variable = InformationItemPropertyConverter.wbFromDMN(dmn.getVariable());
    Expression expression = ExpressionPropertyConverter.wbFromDMN(dmn.getExpression());
    ContextEntry result = new ContextEntry();
    result.setVariable(variable);
    result.setExpression(expression);
    return result;
}
Also used : Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) InformationItem(org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem) ContextEntry(org.kie.workbench.common.dmn.api.definition.v1_1.ContextEntry)

Aggregations

InformationItem (org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem)66 Test (org.junit.Test)33 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)20 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)20 GraphCommandExecutionContext (org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext)19 RuleViolation (org.kie.workbench.common.stunner.core.rule.RuleViolation)18 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)12 Before (org.junit.Before)11 ContextEntry (org.kie.workbench.common.dmn.api.definition.v1_1.ContextEntry)11 List (org.kie.workbench.common.dmn.api.definition.v1_1.List)10 Binding (org.kie.workbench.common.dmn.api.definition.v1_1.Binding)8 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)7 Optional (java.util.Optional)6 InformationItem (org.kie.dmn.model.v1_1.InformationItem)6 HasName (org.kie.workbench.common.dmn.api.definition.HasName)6 Relation (org.kie.workbench.common.dmn.api.definition.v1_1.Relation)6 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)6 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)6 Context (org.kie.workbench.common.dmn.api.definition.v1_1.Context)5 Expression (org.kie.workbench.common.dmn.api.definition.v1_1.Expression)5