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

Fix document : drl functions in a different package cannot be imported

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.34.0.Final
    • 7.73.0.Final, 8.32.0.Final
    • docs
    • None

      Issue Description:

      Drl functions in a different package cannot be imported.

      package com.sample
      
      import function com.func.isOdd;
      
      rule Hello1
      ...
      

      results in

      Error importing : 'com.func.isOdd'
      Rule Compilation error : [Rule name='Hello1']
      	Only a type can be imported. com.func.isOdd resolves to a package
      

      The document is misleading and should be fixed.

      https://docs.drools.org/7.73.0.Final/drools-docs/html_single/#drl-functions-con_drl-rules
      https://docs.drools.org/latest/drools-docs/docs-website/drools/language-reference/index.html#_legacy_functions_in_drl

      On the other hand, Java static methods in a different package can be imported.

      Acceptance Criteria:

      • Fix description about "import function" in docs 7.x and 8. Write that drl functions in a different package cannot be imported.

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: