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

Unable to analyse expression "\"#" in drools

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.4.0.Beta1
    • 6.3.0.Final
    • core engine
    • None
    • Hide

      rule
      ------------------------------------------------
      declare Test
      name : String
      end

      rule 'test'
      when
      $test : Test(name == "\"#")
      then
      System.out.println($test.getName());
      end
      ------------------------------------------------

      Show
      rule ------------------------------------------------ declare Test name : String end rule 'test' when $test : Test(name == "\"#") then System.out.println($test.getName()); end ------------------------------------------------
    • NEW
    • NEW

      I found a weird error with my simple rule.
      Below code(attached "Steps to Reproduce") occur error as "Unable to Analyse Expression..".
      But, if I change "\"#" to "\"" or "#" or "\"\"#", drools did not return error code.
      I think it is related to '#'(Inline casts and coercion-http://docs.jboss.org/drools/release/6.3.0.Final/drools-docs/html_single/index.html)
      I attached my code & exception below.

      Best regards.

      exception
      ------------------------------------------------
      line 1:5 no viable alternative at character '\'
      line 1:8 mismatched character '<EOF>' expecting '"'
      [ERROR][2015-10-29 01:42:20][o.d.c.k.b.i.AbstractKieModule.buildKnowledgePackages] Unable to build KieBaseModel:info
      Unable to Analyse Expression "\" instanceof " && name == ((")"\"):
      [Error: unterminated string literal]
      [Near :

      {... "\" instanceof " && name == ((")"\") ....}

      ]
      ^ : [Rule name='test']

      Predicate '"\" instanceof "' must be a Boolean expression
      [Line: 14, Column: 8] : [Rule name='test']
      ------------------------------------------------

            mfusco@redhat.com Mario Fusco
            ljwandy_jira 재우 이 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: