Search in sources :

Example 31 with DecisionNode

use of org.kie.dmn.api.core.ast.DecisionNode in project drools-wb by kiegroup.

the class AbstractDMNTest method init.

protected void init() {
    settingsLocal = new Settings();
    settingsLocal.setType(ScenarioSimulationModel.Type.DMN);
    inputDataNodes = new HashSet<>();
    simpleTypeNoCollection = getSimpleNoCollection();
    InputDataNode inputDataNodeSimpleNoCollection = getInputDataNode(simpleTypeNoCollection, SIMPLE_INPUT_DATA_NAME_NO_COLLECTION);
    inputDataNodes.add(inputDataNodeSimpleNoCollection);
    simpleTypeSimpleCollectionOfSimple = getSimpleCollection();
    InputDataNode inputDataNodeSimpleCollectionOfSimple = getInputDataNode(simpleTypeSimpleCollectionOfSimple, SIMPLE_INPUT_DATA_NAME_SIMPLE_COLLECTION_OF_SIMPLE);
    inputDataNodes.add(inputDataNodeSimpleCollectionOfSimple);
    compositeTypeNoCollection = getSingleCompositeWithSimpleCollection();
    simpleTypeSimpleCollectionOfComposite = getSimpleCollection(compositeTypeNoCollection);
    InputDataNode inputDataNodeSimpleCollectionOfComposite = getInputDataNode(simpleTypeSimpleCollectionOfComposite, SIMPLE_INPUT_DATA_NAME_SIMPLE_COLLECTION_OF_COMPOSITE);
    inputDataNodes.add(inputDataNodeSimpleCollectionOfComposite);
    compositeTypeCollection = getCompositeCollection();
    InputDataNode inputDataNodeCompositeCollection = getInputDataNode(compositeTypeCollection, COMPOSITE_INPUT_DATA_NAME_COLLECTION);
    inputDataNodes.add(inputDataNodeCompositeCollection);
    decisionNodes = new HashSet<>();
    DecisionNode decisionNodeSimpleNoCollection = getDecisionNode(simpleTypeNoCollection, SIMPLE_DECISION_DATA_NAME);
    decisionNodes.add(decisionNodeSimpleNoCollection);
    DecisionNode decisionNodeCompositeNoCollection = getDecisionNode(compositeTypeNoCollection, COMPOSITE_DECISION_DATA_NAME);
    decisionNodes.add(decisionNodeCompositeNoCollection);
    setDmnModelLocal("dmn-list.dmn", NAMESPACE, MODEL_NAME);
}
Also used : InputDataNode(org.kie.dmn.api.core.ast.InputDataNode) DecisionNode(org.kie.dmn.api.core.ast.DecisionNode) Settings(org.drools.scenariosimulation.api.model.Settings)

Example 32 with DecisionNode

use of org.kie.dmn.api.core.ast.DecisionNode in project drools-wb by kiegroup.

the class AbstractDMNTest method getDecisionNode.

protected DecisionNode getDecisionNode(DMNType dmnType, String name) {
    TDecision decision = new TDecision();
    decision.setName(name);
    DecisionNode toReturn = new DecisionNodeImpl(decision, dmnType);
    return toReturn;
}
Also used : TDecision(org.kie.dmn.model.v1_2.TDecision) DecisionNode(org.kie.dmn.api.core.ast.DecisionNode) DecisionNodeImpl(org.kie.dmn.core.ast.DecisionNodeImpl)

Aggregations

DecisionNode (org.kie.dmn.api.core.ast.DecisionNode)32 InputDataNode (org.kie.dmn.api.core.ast.InputDataNode)16 DMNType (org.kie.dmn.api.core.DMNType)12 BusinessKnowledgeModelNode (org.kie.dmn.api.core.ast.BusinessKnowledgeModelNode)10 DecisionServiceNode (org.kie.dmn.api.core.ast.DecisionServiceNode)9 DecisionNodeImpl (org.kie.dmn.core.ast.DecisionNodeImpl)9 DMNMessage (org.kie.dmn.api.core.DMNMessage)7 DMNModel (org.kie.dmn.api.core.DMNModel)7 DMNDecisionResult (org.kie.dmn.api.core.DMNDecisionResult)6 DMNNode (org.kie.dmn.api.core.ast.DMNNode)6 Optional (java.util.Optional)5 DMNContext (org.kie.dmn.api.core.DMNContext)5 DMNResult (org.kie.dmn.api.core.DMNResult)5 DMNRuntime (org.kie.dmn.api.core.DMNRuntime)5 DMNBaseNode (org.kie.dmn.core.ast.DMNBaseNode)5 DecisionServiceNodeImpl (org.kie.dmn.core.ast.DecisionServiceNodeImpl)5 ArrayList (java.util.ArrayList)4 Collection (java.util.Collection)4 List (java.util.List)4 HashMap (java.util.HashMap)3