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

Using a function in nested objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 6.5.0.Final
    • core engine
    • None
    • Drools 6.5.0.Final
      JDK 1.8

    • 2020 Week 10-12 (from Mar 2)
    • Show
      The project is on gitHub: https://github.com/eggsandbutter/drools-debugging/
    • Workaround Exists
    • Hide

      If I assign the nested object to a local variable and then apply the function, it works:

      ObjectA( $objectB : objectB )
      ObjectB( (someFunction(someVariable)) == 0 ) from $objectB

      Show
      If I assign the nested object to a local variable and then apply the function, it works: ObjectA( $objectB : objectB ) ObjectB( (someFunction(someVariable)) == 0 ) from $objectB
    • Medium
    • NEW
    • NEW
    • 46346040

      I am working with a project with nested objects.
      I have a rule in which I need to make use of a function. If I use this function on a variable in a nested object it does not work (I get a compilation error):

      Using the nested object accessor approach (compilation error "Unable to Analyse Expression"):

      ObjectA( objectB. ( (someFunction(someVariable)) == 0 ) )

      EDIT: The same compilation error occurs as well when just using a more complex operation on variables in nested objects as well (updated project on GitHub):

      ObjectA( objectB. ( (someVariable == 0 || someVariable == 1 ) || (someVariable > -1 || someVariable < 2 )) )

              mfusco@redhat.com Mario Fusco
              rudyatleti R D (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: