Gary Napier wrote:


I have an alarm deftemplate derived from my Alarm class.
I would like jess to analyse these incoming alarms and highlight the important ones. So the output from jess is Super_Alarm. Both classes share many slots / fields.

Now the question.
If i have *deftemplate* Super_Alarm *from class* Super_Alarm *extends* Alarm :

A) Can i cast an alarm to a super alarm and fill in the new fields

No.

B) What is JESS's mechanism for doing this (in comparison to performance of the solution below)

One option would be to have a single class/template: put all the fields required by Super_Alarm into Alarm.

If this is undesirable (too many fields in the Super-only-part) then you could use a separate Super object as an add-on for those Alarm objects representing the super-alarms. This would only need one reference field (Super super) in Alarm. These Super objects could be shadowed by jess facts as well, and it would not be too inconvenient to refer to the Super extension in rule LHSs.

kr
Wolfgang


currently i pass the alarm Object slot into the constructor of Super_Alarm which is full of : this.setX(alarm.getX() );

Thanks
Gary





--------------------------------------------------------------------
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]
--------------------------------------------------------------------


--------------------------------------------------------------------
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