Uploaded image for project: 'JBoss BRMS Platform'
  1. JBoss BRMS Platform
  2. RHBRMS-2390

KIE FileSystem resource type overriding does not work as reported by documentation

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 6.0.0
    • 6.0.0
    • BRE
    • None

    Description

      When a resource is written into the KieFileSystem using the method write( path, Resource ), the resource type is ignored and it will be resolved from the file extension instead. For instance the following test should work regardless of the file extension.

      @Test
      public void testHelloWorldWithResource() throws Exception

      { String drl = "package org.drools.compiler.integrationtests\n" + "import " + Message.class.getCanonicalName() + "\n" + "rule R1 when\n" + " $m : Message( message == \"Hello World\" )\n" + "then\n" + "end\n"; KieServices ks = KieServices.Factory.get(); KieFileSystem kfs = ks.newKieFileSystem().write( ks.getResources() .newReaderResource( new StringReader(drl) ) .setResourceType(ResourceType.DRL) .setSourcePath("src/main/resources/r1.txt") ); ks.newKieBuilder( kfs ).buildAll(); KieSession ksession = ks.newKieContainer(ks.getRepository().getDefaultReleaseId()).newKieSession(); ksession.insert(new Message("Hello World")); int count = ksession.fireAllRules(); assertEquals( 1, count ); }

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mfusco@redhat.com Mario Fusco
            Archiver:
            rhn-support-ceverson Clark Everson
            Tomas Schlosser Tomas Schlosser
            Tomas Schlosser Tomas Schlosser
            etirelli

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty