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

ClassNotFound on class declared in drl file

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      I compile a .drl file and save it as object in .drl.compiled file.
      Loading that file does not work if I use insert() or retract() facts that are of a type declared in the .drl file.
      The way to circumvent this is to use the full class name in the insert, like this:

      insert(new vcm.planner.lock.standard.PossibleSlotLock($ship, $chamber,
      $side, $schedule, $eta, $schedule.getTick(), "existing"));

      And cast the variable to the full class name, like this:

      rule "clean up possible slot lock, when no longer to schedule"
      when
      $p : PossibleSlotLock( $ship; )
      not ToScheduleLock( mover == $ship )
      then
      retract( (vcm.planner.lock.standard.PossibleSlotLock)$p );
      end

      This did work in 5.4.0.Final.

              mfusco@redhat.com Mario Fusco
              wasperen_jira Willem van Asperen (Inactive)
              Archiver:
              rhn-support-ceverson Clark Everson

                Created:
                Updated:
                Resolved:
                Archived: