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

DMN message construction for FEEL error throws NPE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • None
    • dmn engine
    • None
    • 2021 Week 31-33 (from Aug 2), 2021 Week 34-36 (from Aug 23)
    • 3
    • Hide

      Create a literal expression with below FEEL function                                                                          string length(null)

      Show
      Create a literal expression with below FEEL function                                                                          string length(null)
    • undefined
    • NEW
    • NEW

    Description

      When we call the FEEL function like string length(input), contains(input, pattern) or list contains(inputlist, input) and if input is NULL, it is throwing null pointer exception. Can the null be handled internally?

       

      Let's consider a real time scenario, where we are validating the "Phone" number and the value is coming up dynamically. This input attribute is being used in a decision table for pattern matching.

      Phone                                                                         Status

      ======                                                                    =====

      not matches(?,"\d{10}")                                     "Phone is Invalid"

       

      Everyone need not to have a Phone and now if the "Phone" attribute is missing or coming as NULL, it is throwing a null pointer exception. Ideally we are expecting "Phone is Invalid" status.

       

      Attachments

        1. screenshot-1.png
          screenshot-1.png
          12 kB
        2. screenshot-2.png
          screenshot-2.png
          21 kB
        3. Screenshot 2021-08-19 at 09.55.41.png
          Screenshot 2021-08-19 at 09.55.41.png
          289 kB
        4. screenshot-3.png
          screenshot-3.png
          42 kB

        Activity

          People

            mmortari@redhat.com Matteo Mortari
            vvivekraj@athenahealth.com Vivekraj VR (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: