<div dir="ltr"><div></div><div>I'll rewrite the rule and give you feedback tomorrow.<br></div><div><br>"would you be interested in doing some research and see if/how they
<br></div><div>
impact performance and rule authoring?" - No problem. It would be a<br>pleasure for me to help.<br><br></div><div>-markus<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-25 17:22 GMT+01:00 Davide Sottara <span dir="ltr"><<a href="mailto:dsotty@gmail.com" target="_blank">dsotty@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>The "after 20 facts or so" makes me
think that some constraint behaves differently when jitted<br>
(constraints are jitted lazily, to go from interpreted to compiled
mode, only when they are used<br>
often enough).<br>
In fact, there was a bug that was fixed a few days ago regarding a
different behavior of "contains".<br>
The interpreted version would work as String.contains, while the
compiled version would work<br>
as Collection.contains - or vice versa, I don't remember right
now.<br>
<br>
Unfortunately, the fix can't be backported to 5.5.0.Final.<br>
Can you try to rewrite constraints like : <br><div class="">
<br>
_name:catalog['name'] not contains 'Timer'<br>
<br></div>
into <br>
<br>
_name:catalog['name'], ! ((String) catalog['name']).contains(
'Timer' )<br>
<br>
and see if the situation improves? <br>
<br>
<br>
On a totally unrelated topic...<br>
I have also noticed that you have a very peculiar data model..<br>
we developed traits in 5.6 and 6.x to deal with relational models
like yours..<br>
would you be interested in doing some research and see if/how they
<br>
impact performance and rule authoring?<span class="HOEnZb"><font color="#888888"><br>
Davide</font></span><div><div class="h5"><br>
<br>
<br>
On 02/25/2014 02:31 PM, Markus Schneider wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">The reason why I've activated the logging was that
some rules are not fired after inserting a special<br>
amount of facts - in my case exactly 20.<br>
<div class="gmail_extra"><br>
Some more details here:<br>
I work on an Event Correlation & Analysis OSS solution
that's based on Grails & Drools 5.5.0-Final.<br>
I'm using a stateful knowledge session and only call dispose()
when the app is stopped - but all facts <br>
are retracted. The functional testing works fine but as I've
mentioned it before when I run the integration<br>
testing it fails, because rules are not fired
('ClearAlertRule' is not fired) when I insert more than 20
facts. <br>
I saw the errors in the drools log but I didn't know if they
were relevant for my problem here.<br>
I've attached two picts which document the right and the
wrong behavior of the rule processing<br>
- also I've listed the rules of my rulebase.<br>
<br>
</div>
<div class="gmail_extra">Has anybody an idea?<br>
<br>
</div>
<div class="gmail_extra">Cheers,<br>
<br>
</div>
<div class="gmail_extra">-markus<br>
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra"><br>
//------------------------------<br>
rule 'UpdateAlertRule'<br>
//------------------------------<br>
dialect 'mvel'<br>
salience 900<br>
no-loop<br>
when<br>
_event : Event(eventClass == "Event",<br>
_name:catalog['name'],<br>
_category:catalog['category'],<br>
_severity:catalog['severity'],<br>
_state:catalog['state'],<br>
_source:catalog['source'],<br>
_subSource:catalog['subSource'],<br>
_origin:catalog['origin'],<br>
_subOrigin:catalog['subOrigin'],<br>
_owner:catalog['owner'],<br>
_description:catalog['description'],<br>
_selector:("from Alert where " + <br>
"name='" + catalog['name'] + "' " + <br>
"and severity='" + catalog['severity'] +
"' " + <br>
"and not state='Closed'"<br>
)<br>
)<br>
eval(isDuplicate(_event,"UpdateAlertRule",_selector) ==
true)<br>
then<br>
System.out.println("UpdateAlertRule is processed.")<br>
EntityBuilder entityBuilder = new EntityBuilder();<br>
entityBuilder.addProperty("modifiedBy","UpdateAlertRule");<br>
entityBuilder.addProperty("counter",1);<br>
AlertHandler alertHandler = new
AlertHandler(entityBuilder.getProperties(),_selector);<br>
alertHandler.update();<br>
RuleLogHandler ruleLogHandler = new RuleLogHandler();<br>
ruleLogHandler.create("UpdateAlertRule",_name);<br>
end<br>
<br>
//------------------------------<br>
rule 'ClearAlertRule'<br>
//------------------------------<br>
dialect 'mvel'<br>
salience 800<br>
no-loop<br>
when<br>
_event : Event(eventClass == "Event",<br>
_name:catalog['name'] contains 'Info',<br>
_category:catalog['category'],<br>
_severity:catalog['severity'] == 'Harmless',<br>
_state:catalog['state'],<br>
_source:catalog['source'],<br>
_subSource:catalog['subSource'],<br>
_origin:catalog['origin'],<br>
_subOrigin:catalog['subOrigin'],<br>
_owner:catalog['owner'],<br>
_description:catalog['description'],<br>
_selector:("from Alert where " + <br>
"name like '%Error'" + <br>
"and not severity='Harmless'" + <br>
"and not state='Closed'"<br>
)<br>
)<br>
then<br>
System.out.println("ClearAlertRule is processed.")<br>
EntityBuilder entityBuilder = new EntityBuilder();<br>
entityBuilder.addProperty("modifiedBy","ClearAlertRule")<br>
entityBuilder.addProperty("state","Closed");<br>
AlertHandler alertHandler = new
AlertHandler(entityBuilder.getProperties(),_selector);<br>
alertHandler.update();<br>
RuleLogHandler ruleLogHandler = new RuleLogHandler();<br>
ruleLogHandler.create("ClearAlertRule",_name);<br>
end<br>
<br>
//------------------------------<br>
rule 'CreateAlertRule'<br>
//------------------------------<br>
dialect 'mvel'<br>
salience 700<br>
no-loop<br>
when<br>
_event : Event(eventClass == "Event",<br>
_name:catalog['name'],<br>
_category:catalog['category'],<br>
_severity:catalog['severity'],<br>
_priority:catalog['priority'],<br>
_state:catalog['state'],<br>
_source:catalog['source'],<br>
_subSource:catalog['subSource'],<br>
_origin:catalog['origin'],<br>
_subOrigin:catalog['subOrigin'],<br>
_owner:catalog['owner'],<br>
_description:catalog['description'],<br>
_selector:("from Alert where " + <br>
"name='" + catalog['name'] + "' " + <br>
"and severity='" + catalog['severity'] +
"' " + <br>
"and not state='Closed'"<br>
)<br>
)<br>
eval(isDuplicate(_event,"CreateAlertRule",_selector) ==
false)<br>
then<br>
System.out.println("CreateAlertRule is processed.");<br>
EntityBuilder entityBuilder = new EntityBuilder();<br>
entityBuilder.addProperty("modifiedBy","CreateAlertRule");<br>
entityBuilder.addProperty("name",_name);<br>
entityBuilder.addProperty("category",_category);<br>
entityBuilder.addProperty("severity",_severity);<br>
entityBuilder.addProperty("priority",_priority);<br>
entityBuilder.addProperty("state",_state);<br>
entityBuilder.addProperty("source",_source);<br>
entityBuilder.addProperty("subSource",_subSource);<br>
entityBuilder.addProperty("origin",_origin);<br>
entityBuilder.addProperty("subOrigin",_subOrigin);<br>
entityBuilder.addProperty("owner",_owner);<br>
entityBuilder.addProperty("description",_description);<br>
AlertHandler alertHandler = new
AlertHandler(entityBuilder.getProperties(),_selector);<br>
alertHandler.create();<br>
RuleLogHandler ruleLogHandler = new RuleLogHandler();<br>
ruleLogHandler.create("CreateAlertRule",_name);<br>
end<br>
<br>
//------------------------------<br>
rule 'EventRetractionRule'<br>
//------------------------------<br>
dialect 'mvel'<br>
salience 1<br>
no-loop<br>
when<br>
_event : Event(eventClass == "Event",<br>
<br>
_name:catalog['name'] not contains 'Timer'<br>
<br>
<br>
)<br>
then<br>
System.out.println("EventRetractionRule is processed.");<br>
retract(_event);<br>
RuleLogHandler ruleLogHandler = new RuleLogHandler();<br>
ruleLogHandler.create("EventRetractionRule",_name);<br>
end<br>
<br>
<br>
<br>
<div class="gmail_quote">2014-02-25 14:00 GMT+01:00 Markus
Schneider <span dir="ltr"><<a href="mailto:markus.schneider73@gmail.com" target="_blank">markus.schneider73@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>Hi Davide,<br>
<br>
</div>
<div>thank you for the fast response. I've defined
an DebugAgendaEventListener as it's described
here:<br>
Drools Docu 5.5.0-Final/Section 7.2/HelloWorld
example.<br>
<a href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html/index.html" target="_blank">http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html/index.html</a><br>
</div>
<br>
</div>
<div>
Where can I find any docu about the config of the
DebugAgendaEventListener?<br>
</div>
<div>
<div><br>
</div>
<div>Cheers,<br>
</div>
</div>
<br>
</div>
-markus<br>
<div><br>
<br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-02-25 12:59 GMT+01:00
Davide Sottara <span dir="ltr"><<a href="mailto:dsotty@gmail.com" target="_blank">dsotty@gmail.com</a>></span>:
<div>
<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>You likely have configured a
DebugAgendaEventListener, which logs agenda
events (rules activated, fired, etc..)<br>
on the standard error rather than the
standard output. If you want a different
behavior, remove the listener<br>
and implement one of your own.<br>
These are not errors anyway.<br>
Davide
<div>
<div><br>
<br>
On 02/25/2014 09:40 AM, Markus Schneider
wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">
<div>
<div>Hi list, <br>
<br>
</div>
I see the following error msg in my
drools log but I don't know how to
interpret this.<br>
</div>
Do I have a serious problem here?<br>
<div>
<div>
<div>
<div>
<div><br>
</div>
<div> Has anybody a clue?<br>
<br>
</div>
<div>Thanks in advance.<br>
<br>
</div>
<div>Cheers,<br>
</div>
<div><br>
</div>
<div>-markus<br>
</div>
<div><br>
| Error
==>[AfterActivationFiredEvent:
getActivation()=[Activation
rule=UpdateAlertRule,
act#=37, salience=900,
tuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event
: 19]<br>
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]<br>
| Error
==>[BeforeActivationFiredEvent:
getActivation()=[Activation
rule=EventRetractionRule,
act#=36, salience=1,
tuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event
: 19]<br>
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]<br>
EventRetractionRule is
processed.<br>
| Error
==>[ObjectRetractedEventImpl:
getFactHandle()=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event
: 19],
getOldObject()=rapideca.plugins.rbm.entity.Event
: 19,
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87,
getPropagationContext()=PropagationContextImpl
[activeActivations=0,
dormantActivations=2,
entryPoint=EntryPoint::DEFAULT,
factHandle=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event
: 19], leftTuple=[fact
0:19:184363445:184363445:19:DEFAULT:rapideca.plugins.rbm.entity.Event
: 19]<br>
, originOffset=-1,
propagationNumber=40,
rule=[Rule
name=EventRetractionRule,
agendaGroup=MAIN,
salience=1, no-loop=true],
type=1]]<br>
2014-02-25 08:59:03,524
[eventQueueReceiverJmsListenerContainer-1]
INFO log.RuleLogHandler -
RuleLog with id: 38 was
successfully saved.<br>
| Error
==>[AfterActivationFiredEvent:
getActivation()=[Activation
rule=EventRetractionRule,
act#=36, salience=1,
tuple=[fact
0:-1:184363445:184363445:19:null:null]<br>
],
getKnowledgeRuntime()=org.drools.impl.StatefulKnowledgeSessionImpl@6dd4ab87]<br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
<br>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
</div>
</div>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br></div>