Try to change   $role :Role
to   $role :Role()
 
and test .. I am learning too so can't promise anything but it looks like the solution from what i saw in error log .. Let us know.
 
thanks



From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of fakhfakh ismail
Sent: Thursday, April 05, 2007 7:41 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] (no subject)

hello,
first sorry for my bad english
when I execute the code
rule "sample1"
when
            
       $P: User($name : name, email matches ".*@bull.net")
       $role :Role

then
       $role.addUser($P);
 end

User and Role are JavaBean

error is affiched

Exception in thread "main" org.drools.rule.InvalidRulePackage: unknown:12:0 mismatched token: [@78,169:172='then',<33>,12:0]; expecting type '('

    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:34)

Best regard
Ismail



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.




*******************************************************************
*** This email and any files transmitted with it are confidential
and intended solely for the individual or entity to whom they are
addressed. If you have received this email in error destroy it
immediately. ******************************************************
**************** Wal-Mart Confidential ****************************
******************************************