Search in sources :

Example 36 with BusinessKnowledgeModel

use of org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel in project kie-wb-common by kiegroup.

the class PMMLIncludedModelHandlerTest method setupBusinessKnowledgeModelWithNestedFunction.

private List<BusinessKnowledgeModel> setupBusinessKnowledgeModelWithNestedFunction() {
    final List<DRGElement> drgElements = new ArrayList<>();
    final BusinessKnowledgeModel bkm1 = new BusinessKnowledgeModel();
    final FunctionDefinition bkm1Function = new FunctionDefinition();
    bkm1Function.setKind(FunctionDefinition.Kind.FEEL);
    bkm1Function.setExpression(makeNestedLiteralExpression());
    bkm1.setEncapsulatedLogic(bkm1Function);
    final BusinessKnowledgeModel bkm2 = new BusinessKnowledgeModel();
    final FunctionDefinition bkm2Function = new FunctionDefinition();
    bkm2Function.setKind(FunctionDefinition.Kind.FEEL);
    bkm2Function.setExpression(makeNestedPMMLFunctionDefinition(DOCUMENT_NAME_ORIGINAL, MODEL_NAME));
    bkm2.setEncapsulatedLogic(bkm2Function);
    final BusinessKnowledgeModel bkm3 = new BusinessKnowledgeModel();
    final FunctionDefinition bkm3Function = new FunctionDefinition();
    bkm3Function.setKind(FunctionDefinition.Kind.FEEL);
    bkm3Function.setExpression(makeNestedPMMLFunctionDefinition(UNAFFECTED_DOCUMENT, UNAFFECTED_MODEL));
    bkm3.setEncapsulatedLogic(bkm3Function);
    drgElements.add(bkm1);
    drgElements.add(bkm2);
    drgElements.add(bkm3);
    when(dmnGraphUtils.getModelDRGElements()).thenReturn(drgElements);
    return Arrays.asList(bkm1, bkm2, bkm3);
}
Also used : BusinessKnowledgeModel(org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel) ArrayList(java.util.ArrayList) FunctionDefinition(org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition) DRGElement(org.kie.workbench.common.dmn.api.definition.model.DRGElement)

Example 37 with BusinessKnowledgeModel

use of org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel in project kie-wb-common by kiegroup.

the class PMMLIncludedModelHandlerTest method setupBusinessKnowledgeModelWithTopLevelFunction.

private List<BusinessKnowledgeModel> setupBusinessKnowledgeModelWithTopLevelFunction() {
    final List<DRGElement> drgElements = new ArrayList<>();
    final BusinessKnowledgeModel bkm1 = new BusinessKnowledgeModel();
    final FunctionDefinition bkm1Function = new FunctionDefinition();
    bkm1Function.setKind(FunctionDefinition.Kind.FEEL);
    bkm1Function.setExpression(new LiteralExpression());
    bkm1.setEncapsulatedLogic(bkm1Function);
    final BusinessKnowledgeModel bkm2 = new BusinessKnowledgeModel();
    bkm2.setEncapsulatedLogic(makeTopLevelPMMLFunctionDefinition(DOCUMENT_NAME_ORIGINAL, MODEL_NAME));
    final BusinessKnowledgeModel bkm3 = new BusinessKnowledgeModel();
    bkm3.setEncapsulatedLogic(makeTopLevelPMMLFunctionDefinition(UNAFFECTED_DOCUMENT, UNAFFECTED_MODEL));
    bkm1.getId().setValue(NODE1_UUID);
    bkm2.getId().setValue(NODE2_UUID);
    bkm3.getId().setValue(NODE3_UUID);
    drgElements.add(bkm1);
    drgElements.add(bkm2);
    drgElements.add(bkm3);
    when(dmnGraphUtils.getModelDRGElements()).thenReturn(drgElements);
    return Arrays.asList(bkm1, bkm2, bkm3);
}
Also used : BusinessKnowledgeModel(org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel) LiteralExpression(org.kie.workbench.common.dmn.api.definition.model.LiteralExpression) ArrayList(java.util.ArrayList) FunctionDefinition(org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition) DRGElement(org.kie.workbench.common.dmn.api.definition.model.DRGElement)

Aggregations

BusinessKnowledgeModel (org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel)37 Test (org.junit.Test)19 Decision (org.kie.workbench.common.dmn.api.definition.model.Decision)17 KnowledgeSource (org.kie.workbench.common.dmn.api.definition.model.KnowledgeSource)16 View (org.kie.workbench.common.stunner.core.graph.content.view.View)15 InputData (org.kie.workbench.common.dmn.api.definition.model.InputData)14 FunctionDefinition (org.kie.workbench.common.dmn.api.definition.model.FunctionDefinition)11 TextAnnotation (org.kie.workbench.common.dmn.api.definition.model.TextAnnotation)11 DRGElement (org.kie.workbench.common.dmn.api.definition.model.DRGElement)10 DecisionService (org.kie.workbench.common.dmn.api.definition.model.DecisionService)9 ArrayList (java.util.ArrayList)7 Edge (org.kie.workbench.common.stunner.core.graph.Edge)7 Node (org.kie.workbench.common.stunner.core.graph.Node)7 List (java.util.List)6 KnowledgeRequirement (org.kie.workbench.common.dmn.api.definition.model.KnowledgeRequirement)5 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)5 HasComponentWidths (org.kie.workbench.common.dmn.api.definition.HasComponentWidths)4 DMNElement (org.kie.workbench.common.dmn.api.definition.model.DMNElement)4 InformationItemPrimary (org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary)4 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)4