[rules-users] Getting a Drools Fusion - CEP Example to work

s.Daniel sdaniel at wobster.de
Mon Apr 11 11:06:13 EDT 2011


Hello

I have built my first few test rules and now I'm working on moving on to
more complex questions. Since I need to monitor data over time I would like
to lern from the example provided here:
http://javabeans.asia/articles/drools_5_case_study_2_complex_event_processing.html

Unfortunately I can't get the tutorial to work properly. In eclipse I have
the error marker
----------------------
Description	Resource	Path	Location	Type
Error: java.lang.NullPointerException	account.drl	/SlidingWindowCEP/etc
Unknown	Drools Error
----------------------


and upon build and get following error:
----------------------
[81,20]: [ERR 101] Line 81:20 no viable alternative at input '90d' in rule
"NinetyDaysPeriod"
java.lang.IllegalArgumentException: Could not parse knowledge.
	at
net.javabeansdotasia.casestudy.test.Tester.prepareKnowledgeBase(Tester.java:85)
	at net.javabeansdotasia.casestudy.test.Tester.setUp(Tester.java:54)
	at net.javabeansdotasia.casestudy.test.Tester.main(Tester.java:118)
java.lang.NullPointerException
	at
net.javabeansdotasia.casestudy.test.Tester.prepareAccountInfo(Tester.java:98)
	at net.javabeansdotasia.casestudy.test.Tester.setUp(Tester.java:55)
	at net.javabeansdotasia.casestudy.test.Tester.main(Tester.java:118)
Exception in thread "main" java.lang.NullPointerException
	at
net.javabeansdotasia.casestudy.test.Tester.prepareStatefulKnowledgeSession(Tester.java:70)
	at net.javabeansdotasia.casestudy.test.Tester.setUp(Tester.java:56)
	at net.javabeansdotasia.casestudy.test.Tester.main(Tester.java:118)
----------------------

Now if I change 90d to 90m the Nullpointer Error goes away but then two new
markers appear at rule "NinetyDaysPeriod" and rule "FiveLastClaims": 
----------------------
Description	Resource	Path	Location	Type
BuildError: Unable to build expression for 'consequence': [Error: Failed to
compile: 1 compilation error(s): 
 - (4,31) unable to resolve method using strict-mode:
java.lang.Object.setEligibleForBonusClaims(java.lang.Boolean)]
[Near : {... Unknown ....}]
             ^
[Line: 1, Column: 0] '	modify($accountInfo) {
		setAveOfLastClaims($aveOfLastClaims);
		setEligibleForBonusClaims(true);
	};
'	account.drl	/SlidingWindowCEP/etc	line 21	Drools Error
----------------------
Description	Resource	Path	Location	Type
BuildError: Unable to build expression for 'consequence': [Error: Failed to
compile: 1 compilation error(s): 
 - (4,33) unable to resolve method using strict-mode:
java.lang.Object.setEligibleForPeriodicBonus(java.lang.Boolean)]
[Near : {... Unknown ....}]
             ^
[Line: 1, Column: 0] '	modify($accountInfo) {
		setAveForPeriod($aveForPeriod);
		setEligibleForPeriodicBonus(true);
	};
'	account.drl	/SlidingWindowCEP/etc	line 65	Drools Error
----------------------


I'm using Drools 5.1 and JDK 1.6 the tutorial is based upon 5.0 and JDK 1.5
could that be the root of my problem? I'm stuck here and still in the
process of learning Java so any hint is appreciated.

--
View this message in context: http://drools.46999.n3.nabble.com/Getting-a-Drools-Fusion-CEP-Example-to-work-tp2806952p2806952.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list