error
by fakhfakh ismail
hello,
When I execute my code Java an error is affiched
[java] Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/stringtemplate/StringTemplateGroup
[java] at org.drools.semantics.java.RuleBuilder.<clinit>(Unknown Source)
[java] at org.drools.compiler.PackageBuilder.addRule(Unknown Source)
[java] at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)
[java] at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown Source)
[java] at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(Unknown Source)
[java] at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(Unknown Source)
[java] at hero.client.test.DroolsTest.main(DroolsTest.java:32)
I'm sure that the class org/antlr/stringtemplate/StringTemplateGroup exist
thank you for your help.
Best regards
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.
17 years, 7 months
4.0.0-M2: RuleFlow "CannotResolveClassException" error
by Anstis, Michael (M.)
Hi,
I added the Eclipse 4.0.0-M2 plugin and created an example project;
changing the class path to reference core-4.0.0-M2, compiler-4.0.0-M2
and dependencies.
I modified the example to include Ruleflow based upon the wiki entry for
4.0.0-M2 and created a simple RuleFlow with two RuleGroups ("one" and
"two") one for each rule in the Sample.drl.
I also modified the DRL to include Rule-Group attributes ("one" and
"two"). Unfortunately when running within Eclipse I received the
following error:-
com.thoughtworks.xstream.alias.CannotResolveClassException:
org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper :
org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper
at
com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.ja
va:35)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass(XmlFriendlyM
apper.java:44)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAlias
ingMapper.java:49)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProx
yMapper.java:46)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:7
0)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.ja
va:18)
at
com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.ja
va:27)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.ja
va:95)
at
com.thoughtworks.xstream.core.ReferenceByIdMarshallingStrategy.unmarshal
(ReferenceByIdMarshallingStrategy.java:12)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:552)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:540)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:490)
at
org.drools.compiler.ProcessBuilder.addProcessFromFile(ProcessBuilder.jav
a:54)
at com.sample.DroolsTest.readRule(DroolsTest.java:67)
at com.sample.DroolsTest.main(DroolsTest.java:22)
Suspecting I've missed something obvious can you advise?
With kind regards,
Michael Anstis
17 years, 7 months
function compilation error
by JLL
hi all
I've to following error when using one of my drl
Can't i use more than one param in the function call ?
thanks
JLL
javax.ejb.EJBTransactionRolledbackException:
org.drools.rule.InvalidRulePackage: Function Compilation error
Rule Compilation error The method getMin(PrestationFacturable,
PrestationFacturable) in the type GetMin is not applicable for the arguments
(PrestationFacturable, FactHandle)
the drl file is the folowing
package be.labocollard.server.rules ;
import be.labocollard.server.entities.PrestationFacturable;
import be.labocollard.server.entities.Prestation;
function PrestationFacturable getMin(PrestationFacturable pf1,
PrestationFacturable pf2) {
if (pf1.getPrestation().getNombreB() > pf2.getPrestation().getNombreB())
return pf1;
else return pf2;
}
rule "cumul_1"
when
$pf1 : PrestationFacturable( $p1 : prestation ->
($p1.getCodePrestation().equals("120153") ||
$p1.getCodePrestation().equals("120175") ||
$p1.getCodePrestation().equals("120190")))
$pf2 : PrestationFacturable( $p2 : prestation ->
($p2.getCodePrestation().equals("120050") ||
$p2.getCodePrestation().equals("120514")))
then
retract(getMin($pf1, $pf2));
end
--
View this message in context: http://www.nabble.com/function-compilation-error-tf3589880.html#a10032557
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 7 months
Drools bug ?? (3.0.6)
by seeker
I use Drools 3.0.6 and I get some NullPointerException when creating my
facts:
Exception in thread "main" org.drools.RuntimeDroolsException:
java.lang.NullPointerException
at org.drools.rule.EvalCondition.isAllowed(Unknown Source)
at org.drools.reteoo.EvalConditionNode.assertTuple(Unknown Source)
at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
at org.drools.reteoo.JoinNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
at org.drools.reteoo.Rete.assertObject(Unknown Source)
at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
...
Caused by: java.lang.NullPointerException
at org.sercho.shem.rules.Rule_Zeittest_0.eval0(Rule_Zeittest_0.java:25)
at
org.sercho.shem.rules.Rule_Zeittest_0Eval0Invoker.evaluate(Rule_Zeittest_0Eval0Invoker.java:19)
... 21 more
The rule that is causing this goes like this:
rule "Zeittest"
when
room : Room ( )
uhr : AlarmClock( applianceStateResource == ApplianceStateEnum.on,
location == room, $alarmTime : alarmTime )
eval( $alarmTime.getHours() > 10 )
then
...
If I omit the eval, ths error will not occur (and I can access
$alarmTime.getHours() in RHS)
I wonder if I do something wrong or if it is a Drools bug.
Any hints ?
--
View this message in context: http://www.nabble.com/Drools-bug----%283.0.6%29-tf3715030.html#a10392045
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 7 months
conways game of life
by Mark Proctor
For anyone looking for a good and complex example on how to write rules
properly, please look at Conways Game of Life in drools-examples, for
extra bonus points compare it to the old version in M1. You'll see
nearly all the logic is moved from java to the drl and we have removed
the need for nested objects by using objects relaitionally, which also
allows us to exploit cross products to drive the application.
Mark
17 years, 7 months
agenda-group clarification
by ch4nd4n
Hi,
I would like to know if my understanding about agenda-group and salience in
Drools 3.x is correct or not.
# agenda-group fires only if auto-focus is set on any of the rules under the
same agenda-group
# all rules under same agenda-group would get fired first and then it might
switch to any other rule (which might be in or not in agenda-group)
# agenda-group precedes salience if auto-focus is set for the agenda group.
Which means if any other rule (without agenda-group) but higher salience
would be fired only after execution of the all the rules in the
agenda-group.
any clarifications regarding this would be a great help
Thank
Ck
http://www.gfour.net
--
View this message in context: http://www.nabble.com/agenda-group-clarification-tf3714854.html#a10391547
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 7 months
rule creation
by seeker
I'd like to build a rule which tests for a special property.
rule "Timer"
when
clock : AlarmClock( $time : alarmTime)
then
// some consequences..
the problem is the $time. I bound it to a variable so far.
It is a complex object which I actually want to check for
getAlarmTime().getHour() > 10
I dont know how.
I want the rule to fire if the hour of the alarmTime has reached a certain
value.
--
View this message in context: http://www.nabble.com/rule-creation-tf3709922.html#a10376825
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 7 months