>>>>> "Ernest" == friedman hill ernest j <[EMAIL PROTECTED]> writes:

Ernest> Hi David, So it looks like JRules lets you directly match on
Ernest> member variables of Java objects...

Actually, it isn't just member variables; methods can also be
used. Here are two rules; the first matches on member variables, the
second (you might recognize this fragment) invokes a method:

  rule HandleTransientFault {
      when {
        fd:FaultData(level:severity; level equals ext_fault.TRANSIENT);
      } then {
          apply fd {
              severity = ext_fault.WARNING;
              ...
          }
          retract fd;
      }
  }

  rule NoticeLowThreshold {
      when {
          ?tank:Tank(level() < 100);
          not Warning(type() == THRESHOLD; tank() == ?tank);
    } then {
        assert Warning(THRESHOLD, ?tank);
    }
}

Anyhow, I wanted to get this to you before I read the rest of your
reply. Thanks.

Regards,

-- 

-------------------------------------------------------------
David E. Young
Fujitsu Network Communications  "The fact that ... we still
([EMAIL PROTECTED])         live well cannot ease the pain of
                                 feeling that we no longer live nobly."
                                  -- John Updike
"Programming should be fun,
 programs should be beautiful"
  -- P. Graham
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to