Search in sources :

Example 6 with InformationItem

use of org.kie.dmn.model.api.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(), ii));
    }
}
Also used : InformationItem(org.kie.dmn.model.api.InformationItem) TInformationItem(org.kie.dmn.model.v1_2.TInformationItem)

Example 7 with InformationItem

use of org.kie.dmn.model.api.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(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 8 with InformationItem

use of org.kie.dmn.model.api.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.api.InformationItem) TInformationItem(org.kie.dmn.model.v1_4.TInformationItem)

Example 9 with InformationItem

use of org.kie.dmn.model.api.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(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)

Example 10 with InformationItem

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

the class RelationConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    Relation r = (Relation) parent;
    for (InformationItem c : r.getColumn()) {
        writeChildrenNode(writer, context, c, COLUMN);
    }
    for (org.kie.dmn.model.api.List row : r.getRow()) {
        writeChildrenNode(writer, context, row, ROW);
    }
}
Also used : Relation(org.kie.dmn.model.api.Relation) TRelation(org.kie.dmn.model.v1_3.TRelation) InformationItem(org.kie.dmn.model.api.InformationItem)

Aggregations

InformationItem (org.kie.dmn.model.api.InformationItem)32 QName (javax.xml.namespace.QName)9 TInformationItem (org.kie.dmn.model.v1_2.TInformationItem)8 Relation (org.kie.dmn.model.api.Relation)7 FunctionDefinition (org.kie.dmn.model.api.FunctionDefinition)6 ArrayList (java.util.ArrayList)5 DMNType (org.kie.dmn.api.core.DMNType)5 DecisionNode (org.kie.dmn.api.core.ast.DecisionNode)5 List (java.util.List)4 Optional (java.util.Optional)4 Collectors (java.util.stream.Collectors)4 DMNMessage (org.kie.dmn.api.core.DMNMessage)4 BusinessKnowledgeModelNode (org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode)4 DMNNode (org.kie.dmn.api.core.ast.DMNNode)4 DMNBaseNode (org.kie.dmn.core.ast.DMNBaseNode)4 DMNModelImpl (org.kie.dmn.core.impl.DMNModelImpl)4 Msg (org.kie.dmn.core.util.Msg)4 MsgUtil (org.kie.dmn.core.util.MsgUtil)4 DRGElement (org.kie.dmn.model.api.DRGElement)4 Decision (org.kie.dmn.model.api.Decision)4