Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4185

KieBuilder incremental compilation does not return Warns, infos

    Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core engine
    • Labels:
      None
    • Sprint:
      2019 Week 23-25
    • Story Points:
      5
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      Compiling with something like

              final KieAssemblersImpl assemblers = (KieAssemblersImpl) ServiceRegistry.getInstance().get(KieAssemblers.class);
              assemblers.accept(new DMNAssemblerService());
      
               KieServices ks = KieServices.Factory.get();
      
               KieFileSystem kfs = ks.newKieFileSystem();
      
               kfs.write("src/main/resources/org/acme/test_scorecard.pmml", ks.getResources().newClassPathResource("test_scorecard.pmml", DMNRuntimeKiePMMLTest.class));
              KieBuilder kieBuilder = ks.newKieBuilder(kfs).buildAll();
              assertEquals(0, kieBuilder.getResults().getMessages(org.kie.api.builder.Message.Level.ERROR).size());
      
               kfs.write("src/main/resources/org/acme/KiePMMLScoreCard_NOPMMLmodelName.dmn", ks.getResources().newClassPathResource("KiePMMLScoreCard_NOPMMLmodelName.dmn", DMNRuntimeKiePMMLTest.class));
              IncrementalResults addResults = ((InternalKieBuilder) kieBuilder).createFileSet("src/main/resources/org/acme/KiePMMLScoreCard_NOPMMLmodelName.dmn").build();
              LOG.debug("getAddedMessages: {}", addResults.getAddedMessages());
              assertTrue(addResults.getAddedMessages().size() > 0);
      

      would fail on the last assertion, as the WARN message is effectively generated as part of the build, but is not available in returned the list.

      A full reproducer can be found with this PR:
      https://github.com/kiegroup/drools/pull/2389

      Suggestion: parametrize InternalKieBuilder#build to also return list of Warn or Info, besides of just returning list of errors?
      More suggestions here: https://github.com/kiegroup/drools/pull/2389#discussion_r294185056

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  tari_manga Matteo Mortari
                  Tester:
                  Tibor Zimanyi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: