Behavioral differences between session.insert() and entryPoint.insert()?
by Barry Kaplan
I am seeing different behavior whether I insert events directly into session
or into a named entry-point.
The below rule and test is greenbar'ed:
----
rule "How_do_I_correlate_events_arriving_in_2_or_more_streams?"
when
$e : WithdrawalEvent($accountNumber : accountNumber, $amount : amount)
over window:time(30s)
from entry-point "stream"
$f : FraudWarningEvent(accountNumber == $accountNumber) over
window:time(30s)
from entry-point "stream"
then
results.put("accountNumber", $accountNumber);
results.put("amount", $amount);
end
----
def insert(fact) {
session.getWorkingMemoryEntryPoint("stream").insert(fact)
}
@Test
def void How_do_I_correlate_events_arriving_in_2_or_more_streams() {
// Not the same account
insert new WithdrawalEvent(accountNumber: "AAA", amount: 100)
insert new FraudWarningEvent(accountNumber: "BBB")
fireAllRules()
assert results.isEmpty()
// Not within the 30s window
advanceTime 31, SECONDS
insert new FraudWarningEvent(accountNumber: "AAA")
fireAllRules()
assert results.isEmpty()
....
}
----
But if I do not specify a stream in the rules (ie, remove the 'from
entry-point "stream"') and instead insert directly into the session (like
many of the the drools integration do)...
def insert(fact) {
session.insert(fact)
}
...the test fails. It does not matter how far I advance the clock before
inserting the (second) FraudWarningEvent, the rule always fires.
I only found this difference after looking at the integration tests and
seing that I did not need to use a named entry-point for events. Did I
understand incorrectly? (I was looking at
/drools-compiler/src/test/resources/org/drools/integrationtests/test_CEP_DelayingNot.drl
and its associated java test.)
--
View this message in context: http://www.nabble.com/Behavioral-differences-between-session.insert%28%29...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Share 'declare' by adding drl to KnowledgeBuilder?
by Barry Kaplan
I have a drl that only contains a declare statement. When I load a drl
containing rules I also load that drl. But when the rule executes I get an
error which is the same as if I didn't have the declare.
When I debug and check the PackageDescr for the drl containing the 'declare'
the TypeDeclarationDescr is in the package and seems to have the correct
values.
Both the rule and the drl with the 'declare' are in the same package:
declartions.drl:
-----------
package memelet.droolsesper
import memelet.droolsesper.MarketDataEvent
declare MarketDataEvent
@role(event)
@expires(10s)
end
-----------
rule.drl:
-----------
package memelet.droolsesper
import memelet.droolsesper.ArrivalRate
global ArrivalRate arrivalRate
rule "How do I measure the rate of arrival of events in a given time
period?"
/*
select count(*) as cnt from MarketDataEvent.win:time_batch(1 second)
*/
/*
5.0.1 does not support 'time_batch', so the best we can do is capture the
continous count.
*/
when
$rate : Long() from accumulate (
$e: MarketDataEvent() over window:time(1s) from entry-point
"stream", count($e))
then
arrivalRate.value = $rate;
end
-----------
--
View this message in context: http://www.nabble.com/Share-%27declare%27-by-adding-drl-to-KnowledgeBuild...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Looking for guidance / approach to porting a question graph to Drools
by tim fulcher
Hi
Making no bones about it, this is a broad topic request and I've got
little hands-on Drools experience, just looking for some pointers on a
potential Drools approach, feedback appreciated.
Background:
We have a system which asks online users questions to diagnose an
issue (the problem domain isn't important right now).
The questions are structured in a tree/graph such that one question
leads to another until a conclusion - not exactly rocketscience to
this list I suspect! Any question will have n outputs (defined in
configuration); each output is mapped to an option in an HTML
select/radio button.
The key issue though is that this question flow is all running in the
browser, by reading in an XML configuration and parsing this in
javascript. Instead I need this executing server side, i.e. in a rule
engine. One reason is that increasingly questions are being automated
- currently we make an ajax call which decides upon the outcome to
select and therefore move onto the next. This is however a little
clunky at present.
I see Drools as a potential execution engine for our reworked system,
running rules until needing a manual question to be asked, and
triggering question display in a page. Upon the answer the flow
continues in that fashion until a conclusion is reached.
Specific queries:
We have a legacy stack of question flows, how to adapt them into a
syntax amenable to Drools? Can I do this at runtime?
( Our question graphs could be accessed via database access or in an
XML format )
Given many questions have >2 outcomes, I assume each question-answer
permutation would be a rule?
Does every question have to be mapped to a bean to become a fact to
operate on? Given our questions are of a few broad types
(boolean,numeric,select one) is that all I need to model?
In our current setup a user could decide to re-answer an earlier
question and therefore take an alternate route. What would be the
equivalent in Drools?
If this is viable, will I need 1 rule outcome to pose a question and
another to operate on the outcome, i.e. will the rules fire up
to/including the decision to ask a question, then when an answer fact
is injected into working memory the rules will fire from that point
onwards?
Thanks
A:E
15 years, 4 months
clock.advanceTime behaviour?
by Barry Kaplan
I've been using esper for some time with great success. But the appeal of
having integrated rules is overwhelming. To get familiar with Fusion, I'm
trying to implement the esper patterns, yet I and am stuck on the very first
one:
How do I measure the rate of arrival of events in a given time period?"
-> "select count(*) as cnt from MarketDataEvent.win:time_batch(1 second)"
For now I'm just trying to get my rule to fire at all, so its not really
trying to count just trigger when the number events in the window exceeds a
certain number. (But I admit, I'm not sure how to just the get running count
over the window, so if anybody knows...):
declare MarketDataEvent
@role(event)
end
rule "How do I measure the rate of arrival of events in a given time
period?"
when
$count : Long( longValue > 5) from accumulate (
$e: MarketDataEvent() over window:time(1s) from entry-point
"stream", count($e))
then
System.out.println("***** > 5");
end
My test driver is just inserting events every 10ms:
(1..10).each {
drools.clock.advanceTime(10, TimeUnit.MILLISECONDS)
drools.entryPoint.insert(new MarketDataEvent(it as String))
drools.session.fireAllRules()
}
If I do /not/ advance the clock, then I rule fires each time after the 5th
insert. But if the clock /is/ advanced (at any increment) then the rule
never fires.
Any clues what I might be missing?
thanks!
--
View this message in context: http://www.nabble.com/clock.advanceTime-behaviour--tp25205578p25205578.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Re: [rules-users] unable to determine value type class *** URGENT***
by twyt88
hi Crhis,
What's the PMR for this ticket. We have the exact same problem, and I want
to quote IBM for this.
Regards
TT
Crhis wrote:
>
> Had similar (same?) issue with WAS ND 6.1.0.23 (Fixpack 23) which uses 32
> bit Java 5 SR9 build. A nested exception ending with
> "org.drools.RuntimeDroolsException: unable to determine ValueType for
> Class ...". Worked extensively with support on this and it appears SR9
> has a defect with the JIT compiler that precipitates this. There are 3
> ways to address it: Move back to SR8. Wait for SR10 to come out. Work
> with IBM support under your support contract to possibly receive a patch
> specific to your environment.
>
>
>
> Srithu wrote:
>>
>> I have a wired behavior..
>>
>> I have a set of rules and i have used drools-guvnor to packaging them...
>> It is working in windows machines where i have jboss which is running on
>> IBM java 5 and 6..
>>
>> When i connect the same from jboss Which is running on 64 bit IBM java 6
>> on linux is not working...
>> The same is working If i used 64 bit IBM java 5 on linux.....
>>
>>
>> I getting following exception...
>>
>>
>>
>> Please help....
>>
>>>> [2009-02-11 12:30:29,697] [705980] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - org.drools.RuntimeDroolsException: unable to determine
>>>> ValueType for Class [class java.lang.Object]
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.base.ValueType.determineValueType(ValueType.java:193)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.base.ValueType.readResolve(ValueType.java:125)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
>>
>>>> [2009 -02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12]
>>>> [ERROR] [STDERR ] - at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at java.lang.reflect.Method.invoke(Method.java:599)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1072)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1773)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.base.BaseEvaluator.readExternal(BaseEvaluator.java:54)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.rule.LiteralRestriction.readExternal(LiteralRestriction.java:66)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.rule.LiteralConstraint.readExternal(LiteralConstraint.java:67)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.util.ArrayList.readObject(ArrayList.java:717)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at java.lang.reflect.Method.invoke(Method.java:599)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:985)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1860)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1764)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.rule.Pattern.readExternal(Pattern.java:115)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.rule.Declaration.readExternal(Declaration.java:175)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readArray(ObjectInputStream.java:1678)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1334)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.base.mvel.MVELCompilationUnit.readExternal(MVELCompilationUnit.java:166)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.base.mvel.MVELPredicateExpression.readExternal(MVELPredicateExpression.java:38)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:362)
>>
>>>> [2009-02-11 12:30:29,698] [705981] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> org.drools.rule.PredicateConstraint.readExternal(PredicateConstraint.java:131)
>>
>>>> [2009-02-11 12:30:29,699] [705982] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1803)
>>
>>>> [2009-02-11 12:30:29,699] [705982] [http-0.0.0.0-8080-12] [ERROR]
>>>> [STDERR ] - at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
>>
>>
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/unable-to-determine-value-type-class--***-URGENT***...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
What may go in the Action when dialect is java
by jsk@orwtech.dk
Hi
For some time I have been struggling to complete my Drools workflow
without succes.
I am trying to access static methods on som java classes but for some
reason i keep getting NoSuchMethodException when switching the dialect
from "mvel" to "java" to be able to call this methods.
What I have at runtime is a message variable containing a campaign class
instance which I want to parse on to my static method for it to return an
campaign information class instance to me.
Which I then set in a global variable that I read outside the knowledge
session.
The global variable is defined like this:
global com.test.CampaignResult result
The flow variable is defined like this:
com.test.jpa.Message msg;
My code lookes like this:
Campaign c = msg.getCampaign();
CampaignInfo info = CampaignHelper.getCampaignInfo(c);
result.setCampaignInfo(info);
My Drools is 5.0.1
Can anybody help me on getting this to work?
Best regards
Jesper
15 years, 4 months
modify facts problem
by Vikram Pancholi
Hi,
I am having problem about modifying certain fact.
For example
1) I have User status when inserted set to value "1".
2) in the modify in a rule block i m changing this to "5".
3)Now i have a flow where i have a wait which waits this user status is
not value "1".
After the rule is fired ans the status is changed to false, in the next
step i am checking this status of user status in an XOR split constraints
but i still get the status in the constraint as "1". I have got no clues
whts going on. I tried printing this value in the getting the objects using
classobjectfilter and then specyfing the class again, the value is still
shown as "1". I am very much confused about this. Is this some effect of
Shadow facts.
awaiting your response.
Regards
Vikram Pancholi
15 years, 4 months
Using KnowledgeAgent with Stateful session
by nestabur
Does anyone tried to use the knowledgeAgent with statefulSessions?
I've tried to configure my rule engine obtaining unexpected behaviour.
I configure my statefulSession as follows:
wm = (ReteooStatefulSession) ((KnowledgeBaseImpl) kagent
.getKnowledgeBase()).ruleBase.newStatefulSession(
(SessionConfiguration) sessionConf, env);
ksession = new StatefulKnowledgeSessionImpl(wm, kagent.getKnowledgeBase());
And after updating the KnowledgeBase in the agent I update my ksession:
wm.setRuleBase((InternalRuleBase) ((KnowledgeBaseImpl) kagent
.getKnowledgeBase()).ruleBase);
ksession = new StatefulKnowledgeSessionImpl(wm, kagent.getKnowledgeBase());
Without using entry-points this approach works as expected, but using them
it fails after the first update throwing the error:
Exception while processing message: java.lang.NullPointerException
java.lang.NullPointerException
at
org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:54)
at
org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:79)
at
org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:66)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:109)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
Browsing the drools core code I found the line that was throwing the
exception and tried to get the same result by implementing:
if (!((InternalRuleBase) ((KnowledgeBaseImpl)
ksession.getKnowledgeBase()).ruleBase)
.getTypeDeclaration(fact.getClass()) == null)
log.info (((InternalRuleBase) ((KnowledgeBaseImpl)
ksession.getKnowledgeBase()).ruleBase)
.getTypeDeclaration(fact.getClass()).getTimestampExtractor().toString());
after updating my ksession. The result was the same, again the same
exception thrown but my logger wrote:
18:01:50,232 INFO [ClassFieldExtractor class=MyPackage.MyFact
field=myTimestampField]
So I dont know why the core is throwing that exception, is that
implementation correct?, any ideas?
Thanks,
Nestor
--
View this message in context: http://www.nabble.com/Using-KnowledgeAgent-with-Stateful-session-tp251514...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 4 months
Drools problem
by Nilima R
I am trying to create a web application and use drools in that.I have
added all drools libraraies.But when I run the servlet I get the following
error
Unable to load dialect
'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel'
ALso can someone point me where to find the insurance BRMS example listed
in the Drools documentation.It is not present at the specified location
Can anyone point out the mistake .
Thanks
Nilima Rajendra Raichandani
Tata Consultancy Services
Mailto: nilima.r(a)tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
15 years, 4 months