Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3433

DRL parser accepts function written in MVEL

    XMLWordPrintable

Details

    • Hide

      DRL compile this:

      import java.util.Map;
      dialect "mvel"
      function Integer x(String englishNumber){
      Map m = ["one":1, "two":2, "three":3, "four":4, "five":5]; # not Java here!
      Object obj = m.get(englishNumber.toLowerCase());
      return Integer.parseInt(obj.toString());
      }

      Show
      DRL compile this: import java.util.Map; dialect "mvel" function Integer x(String englishNumber){ Map m = ["one":1, "two":2, "three":3, "four":4, "five":5] ; # not Java here! Object obj = m.get(englishNumber.toLowerCase()); return Integer.parseInt(obj.toString()); }

    Description

      A DRL function using MVEL syntax "compiles" without any error indication when dialect "mvel" is set at package lavel.

      import java.util.Map;
      dialect "mvel"
      function Integer x(String englishNumber){
      Map m = ["one":1, "two":2, "three":3, "four":4, "five":5]; # not Java here!
      Object obj = m.get(englishNumber.toLowerCase());
      return Integer.parseInt(obj.toString());
      }

      Attachments

        Issue Links

          Activity

            People

              mfusco@redhat.com Mario Fusco
              laune Wolfgang Laun (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: