Search in sources :

Example 6 with OutputClause

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

the class OutputClauseConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    OutputClause oc = (OutputClause) parent;
    String name = reader.getAttribute(NAME);
    String typeRefValue = reader.getAttribute(TYPE_REF);
    oc.setName(name);
    if (typeRefValue != null)
        oc.setTypeRef(MarshallingUtils.parseQNameString(typeRefValue));
}
Also used : TOutputClause(org.kie.dmn.model.v1_2.TOutputClause) OutputClause(org.kie.dmn.model.api.OutputClause)

Example 7 with OutputClause

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

the class DecisionTableConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    DecisionTable dt = (DecisionTable) parent;
    for (InputClause i : dt.getInput()) {
        writeChildrenNode(writer, context, i, INPUT);
    }
    for (OutputClause o : dt.getOutput()) {
        writeChildrenNode(writer, context, o, OUTPUT);
    }
    for (RuleAnnotationClause a : dt.getAnnotation()) {
        writeChildrenNode(writer, context, a, ANNOTATION);
    }
    for (DecisionRule r : dt.getRule()) {
        writeChildrenNode(writer, context, r, RULE);
    }
}
Also used : OutputClause(org.kie.dmn.model.api.OutputClause) DecisionTable(org.kie.dmn.model.api.DecisionTable) TDecisionTable(org.kie.dmn.model.v1_2.TDecisionTable) RuleAnnotationClause(org.kie.dmn.model.api.RuleAnnotationClause) InputClause(org.kie.dmn.model.api.InputClause) DecisionRule(org.kie.dmn.model.api.DecisionRule)

Example 8 with OutputClause

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

the class OutputClauseConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    OutputClause oc = (OutputClause) parent;
    if (oc.getOutputValues() != null)
        writeChildrenNode(writer, context, oc.getOutputValues(), OUTPUT_VALUES);
    if (oc.getDefaultOutputEntry() != null)
        writeChildrenNode(writer, context, oc.getDefaultOutputEntry(), DEFAULT_OUTPUT_ENTRY);
}
Also used : TOutputClause(org.kie.dmn.model.v1_4.TOutputClause) OutputClause(org.kie.dmn.model.api.OutputClause)

Example 9 with OutputClause

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

the class OutputClausesWithType method inferTypeForOutputClauses.

public List<OutputClauseWithType> inferTypeForOutputClauses(List<OutputClause> outputClauses) {
    List<OutputClauseWithType> outputClausesWithTypes = new ArrayList<>();
    for (OutputClause outputClause : outputClauses) {
        BaseDMNTypeImpl typeRef = inferTypeRef(dmnModel, decisionTable, outputClause);
        outputClausesWithTypes.add(new OutputClauseWithType(outputClause, typeRef));
    }
    return outputClausesWithTypes;
}
Also used : OutputClause(org.kie.dmn.model.api.OutputClause) ArrayList(java.util.ArrayList) BaseDMNTypeImpl(org.kie.dmn.core.impl.BaseDMNTypeImpl)

Example 10 with OutputClause

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

the class OutputClauseConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    OutputClause oc = (OutputClause) parent;
    if (oc.getOutputValues() != null)
        writeChildrenNode(writer, context, oc.getOutputValues(), OUTPUT_VALUES);
    if (oc.getDefaultOutputEntry() != null)
        writeChildrenNode(writer, context, oc.getDefaultOutputEntry(), DEFAULT_OUTPUT_ENTRY);
}
Also used : OutputClause(org.kie.dmn.model.api.OutputClause) TOutputClause(org.kie.dmn.model.v1_3.TOutputClause)

Aggregations

OutputClause (org.kie.dmn.model.api.OutputClause)22 DecisionTable (org.kie.dmn.model.api.DecisionTable)7 InputClause (org.kie.dmn.model.api.InputClause)7 DecisionRule (org.kie.dmn.model.api.DecisionRule)5 QName (javax.xml.namespace.QName)4 TOutputClause (org.kie.dmn.model.v1_2.TOutputClause)4 ArrayList (java.util.ArrayList)3 Decision (org.kie.dmn.model.api.Decision)3 TOutputClause (org.kie.dmn.model.v1_1.TOutputClause)3 TOutputClause (org.kie.dmn.model.v1_3.TOutputClause)3 DMNType (org.kie.dmn.api.core.DMNType)2 BaseDMNTypeImpl (org.kie.dmn.core.impl.BaseDMNTypeImpl)2 InformationItem (org.kie.dmn.model.api.InformationItem)2 LiteralExpression (org.kie.dmn.model.api.LiteralExpression)2 RuleAnnotationClause (org.kie.dmn.model.api.RuleAnnotationClause)2 TDecisionTable (org.kie.dmn.model.v1_2.TDecisionTable)2 TOutputClause (org.kie.dmn.model.v1_4.TOutputClause)2 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1