Search in sources :

Example 1 with FunctionDefinition

use of org.kie.dmn.model.api.FunctionDefinition 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 : TFunctionDefinition(org.kie.dmn.model.v1_1.TFunctionDefinition) FunctionDefinition(org.kie.dmn.model.api.FunctionDefinition) InformationItem(org.kie.dmn.model.api.InformationItem)

Example 2 with FunctionDefinition

use of org.kie.dmn.model.api.FunctionDefinition in project drools by kiegroup.

the class FunctionDefinitionConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    FunctionDefinition i = (FunctionDefinition) parent;
    String kind = reader.getAttribute(KIND);
    if (kind != null) {
        i.setKind(FunctionKind.fromValue(kind));
    }
}
Also used : TFunctionDefinition(org.kie.dmn.model.v1_2.TFunctionDefinition) FunctionDefinition(org.kie.dmn.model.api.FunctionDefinition)

Example 3 with FunctionDefinition

use of org.kie.dmn.model.api.FunctionDefinition 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(xstream, fd.getExpression()));
}
Also used : TFunctionDefinition(org.kie.dmn.model.v1_4.TFunctionDefinition) FunctionDefinition(org.kie.dmn.model.api.FunctionDefinition) InformationItem(org.kie.dmn.model.api.InformationItem)

Example 4 with FunctionDefinition

use of org.kie.dmn.model.api.FunctionDefinition in project drools by kiegroup.

the class FunctionDefinitionConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    FunctionDefinition i = (FunctionDefinition) parent;
    String kind = reader.getAttribute(KIND);
    if (kind != null) {
        i.setKind(FunctionKind.fromValue(kind));
    }
}
Also used : TFunctionDefinition(org.kie.dmn.model.v1_3.TFunctionDefinition) FunctionDefinition(org.kie.dmn.model.api.FunctionDefinition)

Example 5 with FunctionDefinition

use of org.kie.dmn.model.api.FunctionDefinition 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(xstream, fd.getExpression()));
}
Also used : TFunctionDefinition(org.kie.dmn.model.v1_3.TFunctionDefinition) FunctionDefinition(org.kie.dmn.model.api.FunctionDefinition) InformationItem(org.kie.dmn.model.api.InformationItem)

Aggregations

FunctionDefinition (org.kie.dmn.model.api.FunctionDefinition)15 InformationItem (org.kie.dmn.model.api.InformationItem)6 DMNExpressionEvaluator (org.kie.dmn.core.api.DMNExpressionEvaluator)3 EvaluatorResult (org.kie.dmn.core.api.EvaluatorResult)3 ArrayList (java.util.ArrayList)2 Collections (java.util.Collections)2 List (java.util.List)2 Entry (java.util.Map.Entry)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 UUID (java.util.UUID)2 Collectors (java.util.stream.Collectors)2 Collectors.toList (java.util.stream.Collectors.toList)2 QName (javax.xml.namespace.QName)2 Resource (org.kie.api.io.Resource)2 DMNMessage (org.kie.dmn.api.core.DMNMessage)2 DMNType (org.kie.dmn.api.core.DMNType)2 BusinessKnowledgeModelNode (org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode)2 DMNNode (org.kie.dmn.api.core.ast.DMNNode)2 DecisionNode (org.kie.dmn.api.core.ast.DecisionNode)2