Hi Ismail,
If you look at the conditions part of your rule, you can remark that the second condition doesn't follow the JBoss Rules DRL valid syntax: (http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.6/):
bound_variable: Name-of-Bean-Class( constraints)
(from here is the DRL syntax error!)
From your example, activite is a field variable bound to attribute activite, so you have already the wanted value. Use optional $symbol to identify your variables: the code is more readable this way.
$act :activity(activityName != "activite1",$type:type, $activite :
activite)
Best regards,
Oana
fakhfakh ismail <ismail_info2005@yahoo.fr> wrote:
Hello,when I execute this coderule "sample6"whenact :activity(activityName != "activite1",type:type, activite : activite)pp: activite.getactivity()thenact.getActivityName();System.out.println("deux clés ont la meme valeurs " +act.getActivityName());endan error is affichedException in thread "main" org.drools.rule.InvalidRulePackage: Unable to resolve ObjectType 'activite.getActivity'at org.drools.rule.Package.checkValidity(Unknown Source)at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)at org.drools.jsr94.rules.admin.RuleExecutionSetImpl.<init>(Unknown Source)at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(Unknown Source)at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(Unknown Source)at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(Unknown Source)at com.sample.Rule.fireRules(Rule.java:41)at com.sample.Rule.fireRules(Rule.java:70)at com.sample.DroolsTest.main(DroolsTest.java:60)Thank you for your helpBest regardIsmail
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses._______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users