Search in sources :

Example 1 with ContextEntry

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

the class ContextConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    Context c = (Context) parent;
    for (ContextEntry ce : c.getContextEntry()) {
        writeChildrenNode(writer, context, ce, CONTEXT_ENTRY);
    }
}
Also used : MarshallingContext(com.thoughtworks.xstream.converters.MarshallingContext) TContext(org.kie.dmn.model.v1_1.TContext) Context(org.kie.dmn.model.api.Context) ContextEntry(org.kie.dmn.model.api.ContextEntry)

Example 2 with ContextEntry

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

the class ContextEntryConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    ContextEntry ce = (ContextEntry) parent;
    if (ce.getVariable() != null)
        writeChildrenNode(writer, context, ce.getVariable(), VARIABLE);
    writeChildrenNode(writer, context, ce.getExpression(), MarshallingUtils.defineExpressionNodeName(ce.getExpression()));
}
Also used : ContextEntry(org.kie.dmn.model.api.ContextEntry) TContextEntry(org.kie.dmn.model.v1_2.TContextEntry)

Example 3 with ContextEntry

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

the class ContextConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    Context c = (Context) parent;
    for (ContextEntry ce : c.getContextEntry()) {
        writeChildrenNode(writer, context, ce, CONTEXT_ENTRY);
    }
}
Also used : TContext(org.kie.dmn.model.v1_4.TContext) MarshallingContext(com.thoughtworks.xstream.converters.MarshallingContext) Context(org.kie.dmn.model.api.Context) ContextEntry(org.kie.dmn.model.api.ContextEntry)

Example 4 with ContextEntry

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

the class ContextEntryConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    ContextEntry ce = (ContextEntry) parent;
    if (ce.getVariable() != null)
        writeChildrenNode(writer, context, ce.getVariable(), VARIABLE);
    writeChildrenNode(writer, context, ce.getExpression(), MarshallingUtils.defineExpressionNodeName(xstream, ce.getExpression()));
}
Also used : ContextEntry(org.kie.dmn.model.api.ContextEntry) TContextEntry(org.kie.dmn.model.v1_4.TContextEntry)

Example 5 with ContextEntry

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

the class ContextEntryConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    ContextEntry ce = (ContextEntry) parent;
    if (ce.getVariable() != null)
        writeChildrenNode(writer, context, ce.getVariable(), VARIABLE);
    writeChildrenNode(writer, context, ce.getExpression(), MarshallingUtils.defineExpressionNodeName(xstream, ce.getExpression()));
}
Also used : ContextEntry(org.kie.dmn.model.api.ContextEntry) TContextEntry(org.kie.dmn.model.v1_3.TContextEntry)

Aggregations

ContextEntry (org.kie.dmn.model.api.ContextEntry)18 Context (org.kie.dmn.model.api.Context)13 List (java.util.List)8 DMNMessage (org.kie.dmn.api.core.DMNMessage)8 IOException (java.io.IOException)6 Reader (java.io.Reader)6 CoreMatchers.is (org.hamcrest.CoreMatchers.is)6 Test (org.junit.Test)6 DMNMessageType (org.kie.dmn.api.core.DMNMessageType)6 VALIDATE_COMPILATION (org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_COMPILATION)6 VALIDATE_MODEL (org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_MODEL)6 VALIDATE_SCHEMA (org.kie.dmn.validation.DMNValidator.Validation.VALIDATE_SCHEMA)6 MarshallingContext (com.thoughtworks.xstream.converters.MarshallingContext)4 QName (javax.xml.namespace.QName)3 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)3 Assert (org.junit.Assert)3 Assert.assertTrue (org.junit.Assert.assertTrue)3 DMNType (org.kie.dmn.api.core.DMNType)3 BusinessKnowledgeModelNode (org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode)3 DecisionNode (org.kie.dmn.api.core.ast.DecisionNode)3