[rules-users] help! rulerule_key failed to predicate
hello,everyone! I wrote a rule with Drools, I compile the program and get the errors as follows: [3,0]: [ERR 103] Line 3:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule [3,9]: [ERR 101] Line 3:9 no viable alternative at input 'com' in rule package [7,0]: [ERR 101] Line 7:0 no viable alternative at input 'import' in rule package in rule sample I don't know how it happened, looking forward to your reply! thank you !!! PS: My rules are here: dialect mvel package com.sample import com.sample.Server; rule system will execute 'tc' command when eval(Server.Message8388608) then System.out.println(The network is so crowd that it needs repairing.); Runtime.getRuntime().exec(tc);#give the authority and execute the tc command end rule caution when eval(Server.Message==8388608) then System.out.println(caution!The network maybe will get blocked very soon.); end rule fluent network when eval(Server.Message8388608)#conditions then System.out.println(the current network is very good);#actions end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] help! rulerule_key failed to predicate
Hi, I thnik you might need to reposition dialect = mvel. The compiling error will go away if you put it inside each of your rules. See example: rule system will execute 'tc' command when dialect mvel eval(Server.Message8388608) then System.out.println(The network is so crowd that it needs repairing.); Runtime.getRuntime().exec(tc);#give the authority and execute the tc command end rule caution dialect mvel when eval(Server.Message==8388608) then System.out.println(caution!The network maybe will get blocked very soon.); end rule fluent network dialect mvel when eval(Server.Message8388608)#conditions then System.out.println(the current network is very good);#actions end Also, mvel is needed to make the eval statement work. In your case, it might not be needed to work with eval at all. WHEN Server.message should work as well. Providing you have an attribute message in Server with a getter defined. Regards, Frank 赵慧 wrote: hello,everyone! I wrote a rule with Drools, I compile the program and get the errors as follows: [3,0]: [ERR 103] Line 3:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule [3,9]: [ERR 101] Line 3:9 no viable alternative at input 'com' in rule package [7,0]: [ERR 101] Line 7:0 no viable alternative at input 'import' in rule package in rule sample I don't know how it happened, looking forward to your reply! thank you !!! PS: My rules are here: dialect mvel package com.sample import com.sample.Server; rule system will execute 'tc' command when eval(Server.Message8388608) then System.out.println(The network is so crowd that it needs repairing.); Runtime.getRuntime().exec(tc);#give the authority and execute the tc command end rule caution when eval(Server.Message==8388608) then System.out.println(caution!The network maybe will get blocked very soon.); end rule fluent network when eval(Server.Message8388608)#conditions then System.out.println(the current network is very good);#actions end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://drools.46999.n3.nabble.com/rules-users-help-rule-rule-key-failed-to-predicate-tp2823695p2823722.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] help! rulerule_key failed to predicate
The package declaration must be first. You don't have to insert the dialect attribute into each rule. Please consult the manual when programming. -W 2011/4/15 赵慧 zh...@hpnl.ac.cn hello,everyone! I wrote a rule with Drools, I compile the program and get the errors as follows: [3,0]: [ERR 103] Line 3:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule [3,9]: [ERR 101] Line 3:9 no viable alternative at input 'com' in rule package [7,0]: [ERR 101] Line 7:0 no viable alternative at input 'import' in rule package in rule sample I don't know how it happened, looking forward to your reply! thank you !!! PS: My rules are here: dialect mvel package com.sample import com.sample.Server; rule system will execute 'tc' command when eval(Server.Message8388608) then System.out.println(The network is so crowd that it needs repairing.); Runtime.getRuntime().exec(tc);#give the authority and execute the tc command end rule caution when eval(Server.Message==8388608) then System.out.println(caution!The network maybe will get blocked very soon.); end rule fluent network when eval(Server.Message8388608)#conditions then System.out.println(the current network is very good);#actions end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] help! rulerule_key failed to predicate
How can we help you if you don't show us the text of your .drl file? All I can see is that the DRL parser could not find rule (failing several other alternatives) and then found the identifier com and didn't know what to do with it. This happens in line 4, position 0 (a misspelled import?) and 9 (com). -W 2011/4/13 赵慧 zh...@hpnl.ac.cn hi,thank you very much for helping me with the problem.nevertheless,I have got another error. I compile the program and get the errors as follows: [4,0]: [ERR 103] Line 4:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule [4,9]: [ERR 101] Line 4:9 no viable alternative at input 'com' in rule package I don't know how it happened, looking forward to your reply! thank you !!! Try adding 'dialect mvel' (no single quotes) after the rule name to the top of each of the rules. I have seen this error before and doing this resolved the issue. hello,everyone!I wrote a rule with Drools,but the error told me that the field Server.Message is not visible, I can't find how it happens. Please help me, I am almost exhausted with it. thank you. the rules are as follows: package com.sample import com.sample.Server; rule system will execute 'tc' command when eval(Server.Message8388608) then System.out.println(The network is so crowd that it needs repairing.); Runtime.getRuntime().exec(tc);#execute the tc command end rule caution when eval(Server.Message==8388608) then System.out.println(caution!The network maybe will get blocked very soon.); end rule fluent network when eval(Server.Message8388608)#conditions then System.out.println(the current network is very good); #actions end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] help! rulerule_key failed to predicate
hi,thank you very much for helping me with the problem.nevertheless,I have got another error. I compile the program and get the errors as follows: [4,0]: [ERR 103] Line 4:0 rule 'rule_key' failed predicate: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}? in rule [4,9]: [ERR 101] Line 4:9 no viable alternative at input 'com' in rule package I don't know how it happened, looking forward to your reply! thank you !!! Try adding 'dialect mvel' (no single quotes) after the rule name to the top of each of the rules. I have seen this error before and doing this resolved the issue. hello,everyone!I wrote a rule with Drools,but the error told me that the field Server.Message is not visible, I can't find how it happens. Please help me, I am almost exhausted with it. thank you. the rules are as follows: package com.sample import com.sample.Server; rule system will execute 'tc' command when eval(Server.Message8388608) then System.out.println(The network is so crowd that it needs repairing.); Runtime.getRuntime().exec(tc);#execute the tc command end rule caution when eval(Server.Message==8388608) then System.out.println(caution!The network maybe will get blocked very soon.); end rule fluent network when eval(Server.Message8388608)#conditions then System.out.println(the current network is very good); #actions end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users