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

[GSS] (7.10.x) RHS doesn't have a type

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 7.10.1.GA
    • BRE
    • False
    • False
    • Undefined
    • 2021 Week 25-27 (from Jun 21)

      As a follow-up to RHDM-1754, we have a case with the following rule snippet: 
       
          $s2Latest: ParticipantEvent() from accumulate(
              $t2: ParticipantEvent(
                  this != $t1,
                  this meets[2h] $t1,
                  location == "JEWELLERY_STORE"),
              init(Collector c = new Collector(); c.pEvent = null,
              action( if(null == c.pEvent)

      {                     c.pEvent = $t2;                 }

                      else{
                          if($t2.getRegisteredTime() > c.pEvent.getRegisteredTime())

      {                         c.pEvent = $t2;                     }

                      }
                   ),
              reverse(),
              result(c.pEvent)
              )
       
      Collector is just a POJO with a pEvent variable.
       
      Compiling this with the executable model fails with:
       
      Caused by: org.drools.mvelcompiler.MvelCompilerException: RHS doesn't have a type
          at org.drools.mvelcompiler.LHSPhase.lambda$getRHSType$20 (LHSPhase.java:371)
          at java.util.Optional.orElseThrow (Optional.java:408)
          at org.drools.mvelcompiler.LHSPhase.getRHSType (LHSPhase.java:371)
          at org.drools.mvelcompiler.LHSPhase.lambda$visit$3 (LHSPhase.java:125)

       
      How can the return type be defined here? Reproducer project attached.

              mfusco@redhat.com Mario Fusco
              rhn-support-omolinab Oscar Molina
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: