[rules-users] Drools error log msg?

Markus Schneider markus.schneider73 at gmail.com
Wed Feb 26 04:27:18 EST 2014


Hi Davide,

good news, the workaround works - ClearAlertRule / _name:catalog['name'],
((String) catalog['name']).contains( 'Info' )

I tried to understand the concepts of traits (
http://planet.jboss.org/post/new_feature_spotlight_traits_part_1)
but I'm not sure if I really got it ;)

What I'm trying to achive...
===
What I try to do is to store the working memory - that's not really correct
in my case because I don't really
store any facts in the working memory - all facts are rectracted. I store
all facts ('Event' & 'Alerts' ) as GORM Objects
directly into the database. Maybe that's the reason why you think that it
is a very peculiar data model ;)
Lucas Amador described in his book 'Drools Developer's Cookbook' how to use
persistence to store knowledge.
I've tried this but it didn't fit my needs here because 'Alerts' are not
only modified by rules they are also
modified by human interventions (admins/operators) - therefore all facts
('Alerts') must be displayed in a console.
Sometimes a picture is worth than thousand words therefore please take a
look at the following blog post, so it's
probably easier to understand what I'm trying to achive.

http://rapideca.blogspot.de/2014/02/lets-turn-vision-into-reality.html

Maybe there is a much better approach to get the job done - all kind of
help is appreciated!

Cheers,

-markus


2014-02-25 17:42 GMT+01:00 Markus Schneider <markus.schneider73 at gmail.com>:

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


More information about the rules-users mailing list