Declared types - extension
by Michael Anstis
What's the rules around declared types extending another (declared) type?
I've been asked to provide for declared type extension in Guvnor (by
Prakash) but the Expert user-guide doesn't say it exists at the engine
level.
I tried "declare MyType extends java.util.ArrayList" and received a
parser\compiler error stating "java.util.ArrayList was not a declared type"
(or words to that effect) so some form of extension appears possible.
Thanks,
Mike
13 years, 5 months
Re: [rules-dev] [rules-users] NPE on fact insertion if rule has sliding window
by Wolfgang Laun
I'm pretty sure that this is a bug. When compiling a DRL from a Chenge Set,
the resulting package
in the Knowledge Base does not contain declare'd types that do not contain
fields; it only contains declares with at least one field.
This results in a ClassObjectTypeConf with a typeDecl == null, and the
damage is done.
I'd say that this is a show stopper for any combination of ChangeSet / Pojo
as Event.
-W
On 12 July 2011 19:32, John <jfullard(a)progeny.net> wrote:
> Hello,
>
> I've been messing with this for days now and can't get to the bottom of
> this. I'm using drools 5.2.0 Final and setting up my KnowledgeBase with a
> KnowledgeAgent which is pulling a package from guvnor (also 5.2.0 Final).
> I
> do NOT get this error if I use a KnowledgeBuilder and add the exact same
> drl
> file as a resource.
>
> If the DRL in guvnor has a rule that uses a sliding window, i get an NPE
> when trying to insert an object and the following stack trace:
>
> java.lang.NullPointerException
> at
>
> org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:56)
> at
>
> org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:80)
> at
>
> org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:65)
> at
> org.drools.common.NamedEntryPoint.createHandle(NamedEntryPoint.java:705)
> at
> org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:282)
> at
>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
> at
>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
> at
>
> org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
> at john.DroolsError.runRules(DroolsError.java:48)
> at john.DroolsError.main(DroolsError.java:40)
>
> Here is the DRL:
>
> 1. | package drools
> 2. | import simple.SimpleType
> 3. |
> 4. |
> 5. |
> 6. |
> 7. |
> 8. |
> 9. | import simple.SimpleType;
> 10. |
> 11. | declare SimpleType
> 12. | @role(event)
> 13. | end
> 14. |
> 15. | rule "timer"
> 16. | timer (cron:5/5 * * * * ?)
> 17. | when
> 18. | $newest : Number()
> 19. | from accumulate( SimpleType ($num : number) over
> window:time(5s),
> 20. | max($num) )
> 21. | $st : SimpleType( number == $newest.intValue )
> 22. | then
> 23. | System.out.println("SimpleType: " + $st.number);
> 24. | end
> (note: the first import of simple.SimpleType comes from the package
> configuration in guvnor, the second is in the drl file itself. the file
> will
> not validate without the import explicitly listed there, saying the type is
> not declared as an event...)
>
> Here is the Java code:
>
> ResourceChangeScannerConfiguration sconf = ResourceFactory
> .getResourceChangeScannerService()
> .newResourceChangeScannerConfiguration();
> sconf.setProperty("drools.resource.scanner.interval", "20");
>
> ResourceFactory.getResourceChangeScannerService().configure(sconf);
>
> KnowledgeBaseConfiguration config = KnowledgeBaseFactory
> .newKnowledgeBaseConfiguration();
> config.setOption(EventProcessingOption.STREAM);
>
> KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
> .newKnowledgeAgentConfiguration();
> aconf.setProperty("drools.agent.scanDirectories", "true");
> aconf.setProperty("drools.agent.scanResources", "true");
> aconf.setProperty("drools.agent.newInstance", "false");
> KnowledgeBase kbase =
> KnowledgeBaseFactory.newKnowledgeBase(config);
> KnowledgeAgent kagent =
> KnowledgeAgentFactory.newKnowledgeAgent(
> "drools agent", kbase, aconf);
>
> String urlString =
> "
> http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/droo...
> ";
> try {
> URL url = new URL(urlString);
> UrlResource urlResource = (UrlResource)
> ResourceFactory
> .newUrlResource(url);
> urlResource.setBasicAuthentication("enabled");
> urlResource.setUsername("John");
> urlResource.setPassword("");
> kagent.applyChangeSet(urlResource);
> } catch (Exception e) {
> System.out.println("Caught exception: " +
> e.getMessage());
> e.printStackTrace();
> }
>
> ResourceFactory.getResourceChangeNotifierService().start();
> ResourceFactory.getResourceChangeScannerService().start();
>
> StatefulKnowledgeSession ksession =
> kbase.newStatefulKnowledgeSession();
> System.out.println("Initialize drools complete");
>
> SimpleType simp = new SimpleType();
> simp.setNumber(5);
>
> ksession.insert(simp);
>
> Thanks,
> John
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/NPE-on-fact-insertion-if-rule-has-slidi...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
13 years, 5 months
Issues with fixing duplicate rule name declarations in separate resource files.
by Mikael Lönneberg
Hi,
In trying to fix JBRULES-2730 and JBRULES-3063, I noticed that fixing this
issue will actually break MiscTest#testRuleReplacement.
So should this test case be rewritten to not allow rule replacement, or are
there circumstances where rule replacements are allowed and if that is the
case what are those circumstances?
ConsequenceOffsetTest.testConsequenceOffset also fails due to loading two
resource files with the same package and rule name defined in the different
files.
Kind regards
Mikael Lonneberg - gwendo
13 years, 6 months
Duck Typing in Java and Drools 5.2.0 (Re: Traits, Duck Typing and Dynamic Semantic Learning)
by Wolfgang Laun
On 6 July 2011 16:37, Mark Proctor <mproctor(a)codehaus.org> wrote:
> http://blog.athico.com/2011/07/traits-duck-typing-and-dynamic-semantic.html
>
Duck typing is available in Java, and therefore it can be used in Drools
even today, although without the syntactic sugar described by Mark.
Nevertheless, a purely Java-based implementation helps to understand issues
and develop a feeling about the usefulness of the proposed feature.
Here are the Java classes a user might write, using class TripleSet as
provided by the support for duck typing:
public class Person extends TripleSet {
String name;
int age;
Gender gender; // enum Gender { MALE, FEMALE }
}
public interface EatingHabits {
String getLikes();
void setLikes( String value );
String getDislikes();
void setDislikes( String value );
}
public interface FussyEater {
}
Class SessionManager which wraps a StatefulKnowledgeSession provides a
little "glue" for performing "dons" in various forms. It should also be
available as a global.
public class SessionManager {
public SessionManager( StatefulKnowledgeSession kSession ){...}
public FactHandle insert( Object object ){...}
public Object dons( TripleSet tripleSet, Class<?>... interfaces
){...}
public FactHandle insert( TripleSet tripleSet, Class... interfaces
){...}
public void insertLogical( RuleContext rContext, TripleSet tripleSet,
Class... interfaces ){...}
}
We can insert a Person and don it with EatingHabits:
Person p1 = new Person( "John", 12, Gender.MALE );
EatingHabits ehp1 = (EatingHabits)sessionMgr.dons( p1,
EatingHabits.class );
ehp1.setLikes( "cheese" );
ehp1.setDislikes( "spinach" );
sessionMgr.insert( p1 );
sessionMgr.insert( ehp1 );
And here is some DRL code, followed by the resulting output:
function String isa( Object object, java.lang.Class clazz ){
return object.toString() +
(clazz.isInstance( object ) ? " implements " : " doesn't
implement " ) +
clazz.getSimpleName();
}
rule showPerson
salience 100
when
$p: Person()
then
System.out.println( "Person name: " + $p.toString() );
System.out.println( isa( $p, EatingHabits.class ) );
System.out.println( isa( $p, FussyEater.class ) );
end
rule showLikes
when
$l: EatingHabits( likes == "cheese" )
$p: Person( this == $l )
then
System.out.println( $p.getName() + " likes cheese" );
end
rule showDislikes
when
$d: EatingHabits( dislikes != null )
$p: Person( this == $d )
then
System.out.println( $p.getName() + " dislikes " + $d.getDislikes() );
sessionMgr.insertLogical( kcontext, $p, FussyEater.class );
end
rule gotFussyEater
when
$d: FussyEater()
$p: Person( this == $d )
then
System.out.println( $p.getName() + " is a fussy eater" );
end
rule notFussyEater
when
$p: Person()
not FussyEater( this == $p )
then
System.out.println( $p.getName() + " is not a fussy eater" );
end
rule removeDislikes
salience -100
no-loop true
when
$d: EatingHabits()
then
modify( $d ){ setDislikes( null ) }
end
=======================================================
Person name: Person<John,12,MALE>
Person<John,12,MALE> doesn't implement EatingHabits
Person<John,12,MALE> doesn't implement FussyEater
John dislikes spinach
John is a fussy eater
John likes cheese
John is not a fussy eater
John likes cheese
13 years, 6 months
[Road Map] Proposed Roadmap for spring-drools module
by vinodkiran
5.3.0 M1
- [New Feature] - Declarative configuration of listeners (JBRULES-3076)
[Pull Request Pending]
5.3.0 CR1
- Bug fixes for existing and M1 releases(JBRULES-2695, JBRULES-2955 [is
this open?], others)
- create working examples for drools-spring (org.drools.examples.spring.*)
Some time in the Future
- [Upgrade] Spring version from 2.5.6 to 3.0.5
- [New Feature] Add support for declarative configuration of Channels
(org.drools.runtime.Channel) for StatefulSessions
- [New Feature] Add support for declarative configuration of loggers
(console, file, threaded)
- [Controversial] Deprecate the current <drools:ksession
type="stateless|stateful"...> tag, and introduce two separate tags for
better readability <drools:statefulSesion and <drools:statelessSession
- [Enhancement on JBRULES-3076] Ability to group listeners
- [Enhancement] Document the drools-spring.xsd
Some time in the Future-Future
- [Upgrade] Spring version from 3.0.5 to 3.1 (see next for reason)
- [Enhancement] Add support for Spring 3.1 feature - Profiles
(http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/)
- [Enhancement] Spring Annotation support?
I will be able spend time on these topics over the next few days/weeks. But
before I start want directions from the core dev team.
--
View this message in context: http://drools.46999.n3.nabble.com/Road-Map-Proposed-Roadmap-for-spring-dr...
Sent from the Drools: Developer (committer) mailing list mailing list archive at Nabble.com.
13 years, 6 months
Traits, Duck Typing and Dynamic Semantic Learning
by Mark Proctor
http://blog.athico.com/2011/07/traits-duck-typing-and-dynamic-semantic.html
-----
Duck typing is the ability to say that something implements an
interface. In this article I'll focus on triples (sets of key value
pairs) such as Maps in Java or Dictionaries in other languages. I will
outline how the concepts of traits could be used in Drools to infer
semantic abstractions over sets of triples, which allows for dynamic
semantic learning over time. The terms map and triple set will be used
interchangeably.
Duck typing over triples is the ability to say that the instance that
represents the set of triples can be treated like an instance of a
interface. This allows static type safe access to dynamic triple
structures, it also allows abstraction through semantic representation
of what that thing is; i.e. it's not just a set of arbitrary triples, it
is a Student. MVEL does not yet support the "dons", as in "wears"
keyword, so please take this as illustrative. The keyword may change
eventually but it was proposed by Davide Sottara, who is POCing this idea.
I'll use MVEL like syntax to demonstrate:
bean = [ name = "Zod", age = 150 ]
bean dons Human
assertEquals( "Zod", bean.name )
assertEquals( 150, bean.age)
Without the don's keyword to duck type the map to the interface this
would not compile as the compiler would report a static typing error of
unknown fields for “name” and “age”.
Now that we know duck typing can be used to allow static type safety
access to map. What else can we do? In a rule based system if we used
triples to represent facts (which is what semantic ontologies do) we
can't declare up front what interfaces a map wears, and those interfaces
might change over time too. So we can use special rules to dynamically
apply traits to a triple set.
rule Human when
$tp : Map( this contains [ "name" : String, "age" : int ] )
then
$tp dons Human// that $tp instance is now recognised by all other rules that match on Human
end
rule HelloWorld when
$s : Human() // this will actually match against the Map "donned" to Human
then
println( "hello " + $s.name );
end
We can see the rule that applies the trait can probably have a first
class representation for it's use case. Which makes the rules intent far
more obvious thus increasing the readability and maintainability of the
system.
trait Human( String name, int age ) when
end
In the above, "trait" is a new keyword and Human is the trait name. We
pass all the fields and their type as arguments. The triple set must
contain at least those keys, but of course it may contain more. Notice
we have an empty "when" block. The reason for this is we can apply
different logic as to when a trait is applied, beyond just matching
known keys to fields.
For instance if someone is Human and is also 18 years of age or younger
we can apply a further abstraction and say the are not just Human but
also a Student. We use the "dons" keyword after the arguments to say the
existing traits the Map must already wear, i.e. abstractions we already
know about the thing.
trait Student( String name, int age ) dons Human when
age(< 18; )
end
The proposed syntax would allow argument names to be used as the pattern
head and the type is inferred. We could also allow operators to be used
in the positional syntax. This is to give compact sugar for "Integer(
this < 18 ) from age".
So now we have a system to detect and recognise sets of triples and
declare what traits they have; what abstractions we infer for them. As
the system learns new things keys may be added to the map and new
abstractions can be inferred by declaring more traits,which in turn
allows further reasoning. Keys may also be removed which results in
traits being removed.
One of the problems of a purely tripled based approach is performance,
both in terms of execution speed but more important memory usage. If
"name" and "age" both have to be represented as objects the system is
going to bloat fast. What we want is to allow a mixed type system of
static and dynamic relations. The relations are what we refer to for
each of the key/value pairs in the triple set, i.e. a property (bean
getter and setter pair, normally on a member field) is a relation on a
class. When a normal bean is inserted we will know it don's all the
interfaces it implements and thus all the properties those interfaces
declares. When accessing those properties we will do so via the standard
getter or setters. This means properties we know up front and that don't
change, can be declare using standard java fields with getter and
setters. Allowing quick access and low memory utilisation. However we
will allow further relations (triples) to be associated with the
instance, as “dynamic” properties. The specialised 'trait' rules will
uniformly detect existing static properties or dynamically added properties.
It's important to remember that a trait is a runtime applied interface
to given instance, and just that instance. Bean instances of the same
concrete type can wear different traits at any given time. Except of
course for the statically declare interfaces on the concrete implementation.
Lets work through a complete example now. Human is a type declaration
which is generated as an actual class from which beans can be initiated,
“name”, “age” and “gender” are static relations. Young, Boy and
FussyEater are all interfaces. Human extends TripleSet so that we know
that further dynamic relations can be added and traits applied. We
detect the bean instance is “< 18” and thus the trait Young is applied
and that if the gender is M the trait Boy is applied. Further if a
property exists, either static or dynamic (the two are seamless in the
syntax) called “dislikes” with a value of “carrots” we apply the
FussyEater trait.
declare Human extends TripleSet
String name;
int age;
Gender gender; // M/F enum
end<
trait Young(int age) dons Human when
age(< 18; )
en
trait Boy(Gender gender) dons Young when
Gender( Gender.M; )
end
trait FussyEater(String dislikes) dons Boy when
dislikes( “carrots”; )
end
Now that we have a system that can detect and declare fussy eaters, lets
us it. First declare a person who is 16, that will be an actual bean
instance. Then add the dynamic property “dislikes”. Finally insert a new
command to give that person some ice cream.
// Lets declare a new triple for a given bean instance that we instantiated from Human
Human human = new Human( “Zod”, 16 )
human.add( [dislikes : “carrots”] )
insert ( human )
insert( new GiveIceCream( human ) );
We can now have a single rule that disallows fussy eaters from getting
ice cream. How cool is that :)
rule “Don't give icecream to boys who are fussy eaters”
$f : FussyEater()
$d : GiveIceCream( $f; )
then
retract ( $d )
end
13 years, 6 months
Fwd: [rules-users] Classloading error with AspectJ and Drools 5.2.0.Final
by Wolfgang Laun
Nobody from the "core team" acknowledged this as justified - it looks
reasonable to me.
-W
---------- Forwarded message ----------
From: Steven Williams <stevearoonie(a)gmail.com>
Date: 2011/7/6
Subject: Re: [rules-users] Classloading error with AspectJ and Drools
5.2.0.Final
To: Rules Users List <rules-users(a)lists.jboss.org>
Clarification to this - it does also happen when we run our server. So this
is preventing us from upgrading to 5.2
My guess is that getResources should return getParent().getResources()
rather than null.
regards
Steve
On Wed, Jul 6, 2011 at 1:42 PM, Steven Williams <stevearoonie(a)gmail.com>wrote:
> Hi,
>
> I have just upgraded to Drools 5.2.0.Final and am getting a weird error
> when running unit tests.
>
> java.lang.NullPointerException
>
> at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
> ClassLoaderWeavingAdaptor.java:251)
>
> at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
> DefaultWeavingContext.java:130)
>
> at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
> ClassLoaderWeavingAdaptor.java:161)
>
> at
> org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
> Aj.java:271)
>
> at
> org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
> Aj.java:276)
>
> at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)
>
> at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)
>
> at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
> ClassPreProcessorAgentAdapter.java:54)
>
> at sun.instrument.TransformerManager.transform(TransformerManager.java:169
> )
>
> at sun.instrument.InstrumentationImpl.transform(
> InstrumentationImpl.java:365)
>
> at java.lang.ClassLoader.defineClass1(Native Method)
>
> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
>
> at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
>
> at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
> JavaDialectRuntimeData.java:570)
>
> at org.drools.util.CompositeClassLoader$CachingLoader.load(
> CompositeClassLoader.java:258)
>
> at org.drools.util.CompositeClassLoader$CachingLoader.load(
> CompositeClassLoader.java:241)
>
> at org.drools.util.CompositeClassLoader.loadClass(
> CompositeClassLoader.java:88)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
>
> at org.drools.rule.JavaDialectRuntimeData.wire(
> JavaDialectRuntimeData.java:405)
>
> at org.drools.rule.JavaDialectRuntimeData.wire(
> JavaDialectRuntimeData.java:396)
>
> at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
> JavaDialectRuntimeData.java:237)
>
> at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
> DialectRuntimeRegistry.java:132)
>
> at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)
>
> at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)
>
> at org.drools.compiler.PackageBuilder.addPackageFromDrl(
> PackageBuilder.java:360)
>
> at org.drools.compiler.PackageBuilder.addKnowledgeResource(
> PackageBuilder.java:538)
>
> at org.drools.builder.impl.KnowledgeBuilderImpl.add(
> KnowledgeBuilderImpl.java:28)
>
> at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
> KnowledgeBaseBuilder.java:108)
>
> at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
> KnowledgeBaseBuilder.java:69)
>
> at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
> KnowledgeBaseBuilder.java:54)
>
>
> I have traced the problem to org.drools.rule.
> JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
> whereas AspectJ expects it to at least return an empty enumeration - hence
> the NPE. Interestingly the problem does not occur when running our server,
> however we can't upgrade unless our unit tests pass and we can't easily turn
> off aspectj for these.
>
> regards
> Steve
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 6 months
package visibility?
by Wolfgang Laun
Usually a DRL file defines a package. Java classes declared to be in a
package with the same name are accessible in the DRL, without an import.
This is also true for classes with package visibility.
However, evaluation of constraints using fields from classes with package
visibility only fails at runtime. A couple of stack dumps are shown below.
I'm not sure what the intended behaviour is, but if runtime execution is not
possible, compilation ought to fail since the reason is known at compile
time.
-W
Exception in thread "main" java.lang.IllegalAccessError: tried to access
class anno.AnnIntRange from class
org.drools.base.anno.AnnIntRange21716810$getAnnotation
at
org.drools.base.anno.AnnIntRange21716810$getAnnotation.getValue(Unknown
Source)
at org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:86)
at org.drools.rule.Declaration.getValue(Declaration.java:219)
at
anno.Rule_ChkIntRange_0Eval1Invoker.evaluate(Rule_ChkIntRange_0Eval1Invoker.java:16)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:114)
at
org.drools.reteoo.EvalConditionNode.assertLeftTuple(EvalConditionNode.java:173)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:197)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:72)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:101)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:197)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:146)
at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
==================================================================
Exception in thread "main" org.drools.RuntimeDroolsException: [Error: could
not access field: anno.AnnIntRange.method]
[Near : {... method.declaringClass ....}]
^
[Line: 1, Column: 1]
at
org.drools.rule.ReturnValueRestriction.isAllowedCachedRight(ReturnValueRestriction.java:297)
at
org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:121)
at
org.drools.common.SingleBetaConstraints.isAllowedCachedRight(SingleBetaConstraints.java:136)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:154)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at anno.Main.insertAnnotations(Main.java:90)
at anno.Main.makeFacts(Main.java:102)
at anno.Main.execute(Main.java:70)
at anno.Main.main(Main.java:119)
Caused by: [Error: could not access field: anno.AnnIntRange.method]
[Near : {... method.declaringClass ....}]
^
[Line: 1, Column: 1]
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:550)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:336)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:141)
at
org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:67)
at org.mvel2.ast.ASTNode.optimize(ASTNode.java:161)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:117)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:89)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:125)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:118)
at org.mvel2.MVEL.executeExpression(MVEL.java:952)
at
org.drools.base.extractors.MVELClassFieldReader.getValue(MVELClassFieldReader.java:153)
at
org.drools.base.evaluators.EqualityEvaluatorsDefinition$ObjectEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1671)
at
org.drools.rule.ReturnValueRestriction.isAllowedCachedRight(ReturnValueRestriction.java:292)
... 15 more
13 years, 6 months