Hi all,
Happy new year to all of you...
I need one help. I was trying the following rule example, using the Java object model, and working absolutely fine as expected...
;; ----------------------------------------------
(defrule CalcInsuranceRiskHigh
"add rule comment here."
(declare (salience 10))
(and
(com_cts_bfs_tcg_bre_dto_BizObject (OBJECT ?driverObj)(noOfClaims
?noOfClaims
))
(test (>
?noOfClaims
4
))
)
=>
(call ?driverObj setInsuranceRisk "High")
)
;; ----------------------------------------------
(defrule CalcInsuranceRiskMedium
"add rule comment here."
(declare (salience 10))
(and
(com_cts_bfs_tcg_bre_dto_BizObject (OBJECT ?driverObj)(noOfClaims
?noOfClaims
))
(test (>=
?noOfClaims
2
))
(test (<=
?noOfClaims
4
))
)
=>
(call ?driverObj setInsuranceRisk "Medium")
)
Note that, I am doing the following steps from Java code, and not having anything extra inside the .clp file other than the rule (i.e. defrule).
a.) Adding the Java class () to engine classpath,
Rete engine = new Rete();
engine.reset();
engine.defclass("com_cts_bfs_tcg_bre_dto_BizObject", "com.cts.bfs.tcg.bre.dto.BizObject", null);
b.) Creating the fact in working memory by providing the Java object (com.cts.bfs.tcg.bre.dto.BizObject)
engine.definstance("com_cts_bfs_tcg_bre_dto_BizObject", bizObject, true, engine.getGlobalContext());
c.) Load and fire the rules.
engine.batch("CalculateGrade.clp");
engine.run();
Issue is while I am opening the rule in Eclipse editor (installed with JESS Eclipse plugin). The ERROR (Red Cross Mark in the left side of editor) is showing at (OBJECT ?driverObj) definition in Editor as follows -
Undefined function or construct at token 'age'
No such slot OBJECT in template MAIN::com_cts_bfs_tcg_bre_dto_BizObject at token 'OBJECT'
No such variable driverObj
Expected a '(', constant, or global variable at token ')'
Could anyone please tell me, what might be the issue? Is there something, which I am still missing in order to comply with Jess Eclipse editor standard, although not creating any issue during rule firing time? I am using the JESS 7.1.0 evaluation version.
Regards
DEBASISH DALUI (122816)
----------------------------------------------
Cognizant Technology Solutions US Corp
Cell : +1-216-835-2902
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.