Log messages are in not in the expected order
by Malinda Kaushalye
Hi All,
Im writing an event driven application where I need to log
1. When a particular event get triggered.
2. When a particular event pattern (condition) is matched.
Events are fired both in the Java code as well as within the drools rule RHS.
Event patterns are matched in the drools LHS.
The issue is the logged message of firing an event is recorded after the LHS evaluation is matched. This happens when the event is fired within the Java code.
e.g. Let's assume there is a precondition (e1 && e2) of a rule. The event e1 is fired by the Java code and event e2 is fired by the RHS of a rule.
In that case the record sequence is
- e2 fired
- (e1 & e2) evaluated
- e1 fired.
The above seems wrong isn't it? It should be
- e1 fired
- e2 fired
- (e1 & e2) evaluated
I use log4j for logging. But this is the case even when I tried System.out.println
Any clue?
Cheers,
Malinda
15 years, 10 months
Rule in decision table
by Jeffrey Schneller
I am trying to write a condition for a decision table and can't seem to
figure out how to do it.
I have a global variable called area. This is in sq. ft.
I have a fact called Item which has an attribute called weight. This is
in grams / sq. ft.
The Item comes from the attribute called value from a fact named Choice
where the sku attribute matches what is in the rule
I want to compare the (weight * area) to the parameter for the row. The
parameter is being passed in as lbs.
Here is what I tried for my three condition columns:
CONDITION
CONDITION
CONDITION
mm : Choice
sku
exists(Item(weight * area > ($param * 453.5924)) from mm.value)
exists(Item(weight * area <= ($param * 453.5924)) from mm.value)
This did not work. This will work if I remove the formula and just do
something like exists(Item(weight > $param) from mm.value). So the
syntax is correct except for the comparison that I want to do.
Any ideas on how to do this?
Thanks.
15 years, 10 months
Authorizing the binary package URL - Drools Guvnor
by Sartaj Shaik
Hi,
I am new to drools guvnor and I have a question regarding the authorization
of binary package.
To use the rule agent, we have to call it something like..
RuleAgent agent = RuleAgent.newRuleAgent("/MyRules.properties");
RuleBase rb = agent.getRuleBase();
Following is the MyRules.properties
##
## RuleAgent configuration file example
##
newInstance=true
url=http:
//localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/XYZ/LATEST
localCacheDir=/foo/bar/cache
poll=30
name=XYZAgent
Any one who know this URL(http:
//localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/XYZ/LATEST)
can dowload my package/drl. So how can we protect it from unauthorized
access.
Thanks
Sartaj.
=====-----=====-----=====
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, 10 months
Application based rule management
by Luiz Eduardo Guida Valmont
Hi all,
>From what I could grasp after looking at the Guvnor documentation, it
provides no API. Since it would be a (very) bad idea to re-develop such
(complex) simple feature, I'm wondering whether there is an API to manage a
set of rules, poll it for changes and update it accordingly.
I cannot use RuleAgent from drools-core since its underpinnings require that
all rules from a package be written in a single file (considering automatic
loading of all rules in a directory). I could dive into the code and adapt
the scanners to do what I want but that's not as feasible as I'd like it to
be. It's better to just use something that's been developed and tested.
Any ideas/thoughts?
Regards,
Luiz Valmont
15 years, 10 months
What is the Best practice of using "Drools Fusion" in a Load balancing environment (ie temporal reasoning between 2 working memories)??
by Chetan Mahadev
Hi
Can anyone tell me how to Implement temporal based event correlation using
drools fusion in a load balancing environment.
What is the best practice in a situation like this??
Use case : To correlate events which comes into the system with in a time
window.
Scenario1:
Single System Scenario: that is One working memory
1.All the events come into the system,
2.Temporal based rules are written using Drools-Fusion.
3.Correlations takes place if all the events come with in the time window,
else the rule expires.
Note: All these takes place with in a single working memory ( Single System)
Scenario2:
Two System Scenario in active/active: that is two working memories
1.All the events come into the system,
2.Temporal based rules are written using Drools-Fusion.
3. Same rules are deployed in both the systems (active/active)
4.Both systems are load-balanced,
5. Event1 goes to System1, Event2 goes to System2 and again Event3 goes
system1. ( load -balanced)
As a result, System1 recieves 2 events out of 3 events, and System2 the
other 1 event.
Correlation never happens since I dont recieve all the events in a single
working memory.
How do we handle this kinda scenario??
Do we have any best practise that is followed in a clustered or
load-balanced environment??
Pls help me.. I am stuck.
Regds
Chetan
In a single system, Fusion/temporal based correlation works completely fine.
Use case:
I have a situation, where events flow into two active components (both
running simultaneosly)
15 years, 10 months
How to use Drools 5 TimeMachine for controlling effective dates?
by H.C.
Hey,
I have a use case where we need to retroactively process data using rules,
but with the rules that were effective at the time the data was created
(maybe a year ago), not at the time the data is run through the engine
(today). We are setting effective and expiration dates on our rules to
accomplish this.
I am now trying to figure out how to control the date the agenda sees
against which it evaluates which rules are in effect. I understand the
TimeMachine class is part of this control mechanism but I am not sure how to
properly use it in the context of a session.
We may have multiple stateless sessions executing at the same time and each
session needs its own independent control over its date parameter.
Thanks
HC
--
View this message in context: http://n3.nabble.com/How-to-use-Drools-5-TimeMachine-for-controlling-effe...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 10 months