Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1217

Negation (!) doesnot work with In operator.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 7.7.0.GA
    • 7.0.1.GA, 7.6.0.GA
    • BRE
    • Occurring in all environments

    • Release Notes
    • CR1
    • +
    • Workaround Exists
    • Hide

      The customer can use instead "Not In" operator

      Show
      The customer can use instead "Not In" operator
    • Hide

      Drl used:
      package com.rule;
      import com.rule.Person;
      rule "Sample Rule"
      salience 13
      dialect "mvel"
      when
      $person:Person(!(name in ('value1','value2','value3'))) // doesnt work

      //$person:Person((name in ('value1','value2','value3'))) // Works without ! symbol
      then
      $person.status = "active";
      end

      "Note: I know if i use 'not in' operator which gives the expected result. In my use case i want to use ! and i don't want to change the condition to $person:Person((name not in ('value1','value2','value3'))) to achieve same behaviour."

      Show
      Drl used: package com.rule; import com.rule.Person; rule "Sample Rule" salience 13 dialect "mvel" when $person:Person(!(name in ('value1','value2','value3'))) // doesnt work //$person:Person((name in ('value1','value2','value3'))) // Works without ! symbol then $person.status = "active"; end "Note: I know if i use 'not in' operator which gives the expected result. In my use case i want to use ! and i don't want to change the condition to $person:Person((name not in ('value1','value2','value3'))) to achieve same behaviour."
    • 2020 Week 04-06 (from Jan 20)

      Use case: The drls are built dynamically and want to use ! along with In,not in and other operators.

      Error:
      " Unable to Analyse Expression !(name in ("value1","value2","value3")):
      [Error: unexpected token: ]
      [Near :

      {... !(name in ("value1","value2"," ....}

      ] "

              mfusco@redhat.com Mario Fusco
              rhn-support-luzrodri Luz Rodriguez
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: