Search in sources :

Example 1 with KnowledgeRequirement

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

the class DecisionConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    Decision dec = (Decision) parent;
    if (dec.getQuestion() != null)
        writeChildrenNodeAsValue(writer, context, dec.getQuestion(), QUESTION);
    if (dec.getAllowedAnswers() != null)
        writeChildrenNodeAsValue(writer, context, dec.getAllowedAnswers(), ALLOWED_ANSWERS);
    if (dec.getVariable() != null)
        writeChildrenNode(writer, context, dec.getVariable(), VARIABLE);
    for (InformationRequirement ir : dec.getInformationRequirement()) {
        writeChildrenNode(writer, context, ir, INFORMATION_REQUIREMENT);
    }
    for (KnowledgeRequirement kr : dec.getKnowledgeRequirement()) {
        writeChildrenNode(writer, context, kr, KNOWLEDGE_REQUIREMENT);
    }
    for (AuthorityRequirement ar : dec.getAuthorityRequirement()) {
        writeChildrenNode(writer, context, ar, AUTHORITY_REQUIREMENT);
    }
    for (DMNElementReference so : dec.getSupportedObjective()) {
        writeChildrenNode(writer, context, so, SUPPORTED_OBJECTIVE);
    }
    for (DMNElementReference ipi : dec.getImpactedPerformanceIndicator()) {
        writeChildrenNode(writer, context, ipi, IMPACTED_PERFORMANCE_INDICATOR);
    }
    for (DMNElementReference dm : dec.getDecisionMaker()) {
        writeChildrenNode(writer, context, dm, DECISION_MAKER);
    }
    for (DMNElementReference downer : dec.getDecisionOwner()) {
        writeChildrenNode(writer, context, downer, DECISION_OWNER);
    }
    for (DMNElementReference up : dec.getUsingProcess()) {
        writeChildrenNode(writer, context, up, USING_PROCESS);
    }
    for (DMNElementReference ut : dec.getUsingTask()) {
        writeChildrenNode(writer, context, ut, USING_TASK);
    }
    if (dec.getExpression() != null) {
        Expression e = dec.getExpression();
        String nodeName = MarshallingUtils.defineExpressionNodeName(e);
        writeChildrenNode(writer, context, e, nodeName);
    }
}
Also used : KnowledgeRequirement(org.kie.dmn.model.api.KnowledgeRequirement) DMNElementReference(org.kie.dmn.model.api.DMNElementReference) InformationRequirement(org.kie.dmn.model.api.InformationRequirement) Expression(org.kie.dmn.model.api.Expression) AuthorityRequirement(org.kie.dmn.model.api.AuthorityRequirement) TDecision(org.kie.dmn.model.v1_1.TDecision) Decision(org.kie.dmn.model.api.Decision)

Example 2 with KnowledgeRequirement

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

the class BusinessKnowledgeModelConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    BusinessKnowledgeModel bkm = (BusinessKnowledgeModel) parent;
    if (bkm.getEncapsulatedLogic() != null)
        writeChildrenNode(writer, context, bkm.getEncapsulatedLogic(), ENCAPSULATED_LOGIC);
    // Now as Invocable: if (bkm.getVariable() != null) writeChildrenNode(writer, context, bkm.getVariable(), VARIABLE);
    for (KnowledgeRequirement i : bkm.getKnowledgeRequirement()) {
        writeChildrenNode(writer, context, i, KNOWLEDGE_REQUIREMENT);
    }
    for (AuthorityRequirement a : bkm.getAuthorityRequirement()) {
        writeChildrenNode(writer, context, a, AUTHORITY_REQUIREMENT);
    }
}
Also used : KnowledgeRequirement(org.kie.dmn.model.api.KnowledgeRequirement) BusinessKnowledgeModel(org.kie.dmn.model.api.BusinessKnowledgeModel) TBusinessKnowledgeModel(org.kie.dmn.model.v1_2.TBusinessKnowledgeModel) AuthorityRequirement(org.kie.dmn.model.api.AuthorityRequirement)

Example 3 with KnowledgeRequirement

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

the class DecisionConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    Decision dec = (Decision) parent;
    if (dec.getQuestion() != null)
        writeChildrenNodeAsValue(writer, context, dec.getQuestion(), QUESTION);
    if (dec.getAllowedAnswers() != null)
        writeChildrenNodeAsValue(writer, context, dec.getAllowedAnswers(), ALLOWED_ANSWERS);
    if (dec.getVariable() != null)
        writeChildrenNode(writer, context, dec.getVariable(), VARIABLE);
    for (InformationRequirement ir : dec.getInformationRequirement()) {
        writeChildrenNode(writer, context, ir, INFORMATION_REQUIREMENT);
    }
    for (KnowledgeRequirement kr : dec.getKnowledgeRequirement()) {
        writeChildrenNode(writer, context, kr, KNOWLEDGE_REQUIREMENT);
    }
    for (AuthorityRequirement ar : dec.getAuthorityRequirement()) {
        writeChildrenNode(writer, context, ar, AUTHORITY_REQUIREMENT);
    }
    for (DMNElementReference so : dec.getSupportedObjective()) {
        writeChildrenNode(writer, context, so, SUPPORTED_OBJECTIVE);
    }
    for (DMNElementReference ipi : dec.getImpactedPerformanceIndicator()) {
        writeChildrenNode(writer, context, ipi, IMPACTED_PERFORMANCE_INDICATOR);
    }
    for (DMNElementReference dm : dec.getDecisionMaker()) {
        writeChildrenNode(writer, context, dm, DECISION_MAKER);
    }
    for (DMNElementReference downer : dec.getDecisionOwner()) {
        writeChildrenNode(writer, context, downer, DECISION_OWNER);
    }
    for (DMNElementReference up : dec.getUsingProcess()) {
        writeChildrenNode(writer, context, up, USING_PROCESS);
    }
    for (DMNElementReference ut : dec.getUsingTask()) {
        writeChildrenNode(writer, context, ut, USING_TASK);
    }
    if (dec.getExpression() != null) {
        Expression e = dec.getExpression();
        String nodeName = MarshallingUtils.defineExpressionNodeName(e);
        writeChildrenNode(writer, context, e, nodeName);
    }
}
Also used : KnowledgeRequirement(org.kie.dmn.model.api.KnowledgeRequirement) DMNElementReference(org.kie.dmn.model.api.DMNElementReference) InformationRequirement(org.kie.dmn.model.api.InformationRequirement) Expression(org.kie.dmn.model.api.Expression) AuthorityRequirement(org.kie.dmn.model.api.AuthorityRequirement) TDecision(org.kie.dmn.model.v1_2.TDecision) Decision(org.kie.dmn.model.api.Decision)

Example 4 with KnowledgeRequirement

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

the class BusinessKnowledgeModelConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    BusinessKnowledgeModel bkm = (BusinessKnowledgeModel) parent;
    if (bkm.getEncapsulatedLogic() != null)
        writeChildrenNode(writer, context, bkm.getEncapsulatedLogic(), ENCAPSULATED_LOGIC);
    // Now as Invocable: if (bkm.getVariable() != null) writeChildrenNode(writer, context, bkm.getVariable(), VARIABLE);
    for (KnowledgeRequirement i : bkm.getKnowledgeRequirement()) {
        writeChildrenNode(writer, context, i, KNOWLEDGE_REQUIREMENT);
    }
    for (AuthorityRequirement a : bkm.getAuthorityRequirement()) {
        writeChildrenNode(writer, context, a, AUTHORITY_REQUIREMENT);
    }
}
Also used : KnowledgeRequirement(org.kie.dmn.model.api.KnowledgeRequirement) BusinessKnowledgeModel(org.kie.dmn.model.api.BusinessKnowledgeModel) TBusinessKnowledgeModel(org.kie.dmn.model.v1_3.TBusinessKnowledgeModel) AuthorityRequirement(org.kie.dmn.model.api.AuthorityRequirement)

Example 5 with KnowledgeRequirement

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

the class BusinessKnowledgeModelConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    BusinessKnowledgeModel bkm = (BusinessKnowledgeModel) parent;
    if (bkm.getEncapsulatedLogic() != null)
        writeChildrenNode(writer, context, bkm.getEncapsulatedLogic(), ENCAPSULATED_LOGIC);
    // Now as Invocable: if (bkm.getVariable() != null) writeChildrenNode(writer, context, bkm.getVariable(), VARIABLE);
    for (KnowledgeRequirement i : bkm.getKnowledgeRequirement()) {
        writeChildrenNode(writer, context, i, KNOWLEDGE_REQUIREMENT);
    }
    for (AuthorityRequirement a : bkm.getAuthorityRequirement()) {
        writeChildrenNode(writer, context, a, AUTHORITY_REQUIREMENT);
    }
}
Also used : KnowledgeRequirement(org.kie.dmn.model.api.KnowledgeRequirement) TBusinessKnowledgeModel(org.kie.dmn.model.v1_4.TBusinessKnowledgeModel) BusinessKnowledgeModel(org.kie.dmn.model.api.BusinessKnowledgeModel) AuthorityRequirement(org.kie.dmn.model.api.AuthorityRequirement)

Aggregations

KnowledgeRequirement (org.kie.dmn.model.api.KnowledgeRequirement)13 AuthorityRequirement (org.kie.dmn.model.api.AuthorityRequirement)8 InformationRequirement (org.kie.dmn.model.api.InformationRequirement)5 BusinessKnowledgeModel (org.kie.dmn.model.api.BusinessKnowledgeModel)4 DMNElementReference (org.kie.dmn.model.api.DMNElementReference)4 Decision (org.kie.dmn.model.api.Decision)4 Expression (org.kie.dmn.model.api.Expression)4 BusinessKnowledgeModelNode (org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode)1 DecisionNode (org.kie.dmn.api.core.ast.DecisionNode)1 DecisionServiceNode (org.kie.dmn.api.core.ast.DecisionServiceNode)1 InputDataNode (org.kie.dmn.api.core.ast.InputDataNode)1 TBusinessKnowledgeModel (org.kie.dmn.model.v1_1.TBusinessKnowledgeModel)1 TDecision (org.kie.dmn.model.v1_1.TDecision)1 TKnowledgeRequirement (org.kie.dmn.model.v1_1.TKnowledgeRequirement)1 TBusinessKnowledgeModel (org.kie.dmn.model.v1_2.TBusinessKnowledgeModel)1 TDecision (org.kie.dmn.model.v1_2.TDecision)1 TKnowledgeRequirement (org.kie.dmn.model.v1_2.TKnowledgeRequirement)1 TBusinessKnowledgeModel (org.kie.dmn.model.v1_3.TBusinessKnowledgeModel)1 TDecision (org.kie.dmn.model.v1_3.TDecision)1 TKnowledgeRequirement (org.kie.dmn.model.v1_3.TKnowledgeRequirement)1