Search in sources :

Example 1 with InformationItem

use of org.kie.dmn.model.api.InformationItem in project kie-wb-common by kiegroup.

the class DMNMarshallerImportsHelperStandaloneImpl method updateInformationItem.

private void updateInformationItem(final String namespace, final DRGElement drgElement) {
    getInformationItem(drgElement).ifPresent(informationItem -> {
        final InformationItem tInformationItem = new TInformationItem();
        final QName qName = informationItem.getTypeRef();
        if (qName != null && !isBuiltInType(qName.getLocalPart())) {
            tInformationItem.setTypeRef(new QName(qName.getNamespaceURI(), namespace + "." + qName.getLocalPart(), qName.getPrefix()));
            setInformationItem(drgElement, tInformationItem);
        }
    });
}
Also used : QName(javax.xml.namespace.QName) TInformationItem(org.kie.dmn.model.v1_2.TInformationItem) TInformationItem(org.kie.dmn.model.v1_2.TInformationItem) InformationItem(org.kie.dmn.model.api.InformationItem)

Example 2 with InformationItem

use of org.kie.dmn.model.api.InformationItem in project kie-wb-common by kiegroup.

the class InformationItemPrimaryPropertyConverterTest method testDmnFromWBWhenWBIsNull.

@Test
public void testDmnFromWBWhenWBIsNull() {
    final InformationItemPrimary wb = null;
    final InformationItem informationItem = InformationItemPrimaryPropertyConverter.dmnFromWB(wb, wb);
    assertNull(informationItem);
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) InformationItem(org.kie.dmn.model.api.InformationItem) TInformationItem(org.kie.dmn.model.v1_2.TInformationItem) Test(org.junit.Test)

Example 3 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(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 4 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()));
}
Also used : TInformationItem(org.kie.dmn.model.v1_1.TInformationItem) InformationItem(org.kie.dmn.model.api.InformationItem)

Example 5 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 : TInformationItem(org.kie.dmn.model.v1_1.TInformationItem) 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