Proper order for resource scanners and notifiers?
by ljnelson
Another newcomer question.
I have studied the javadocs, such as they are, for KnowledgeAgentFactory.
It seems to suggest, though not explicitly state, that one should invoke
some combination of ResourceChangeNotifier and ResourceChangeScanner to
cause the KnowledgeAgent to become aware of new rule bases.
Then it says that both services must be started, even though both services
are presumably not aware of each other.
And none of the sample code actually seems to hook the notifier up to the
scanner.
Then, it also looks like the KnowledgeAgent (Impl) itself wires these two
things up. But it seems to do it backwards (to my way of thinking): the
scanner is added to the notifier?
Somewhere around here is where my eyes start to glaze over. :-D
What is the proper sequence for setting up a knowledge agent so that the
file system is scanned, say, every 30 seconds? The KnowledgeAgentFactory
documentation looks like it *wants* to explain this, but doesn't get all the
way there.
Just want to make sure I'm doing everything right.
Thanks,
Laird
--
View this message in context: http://n3.nabble.com/Proper-order-for-resource-scanners-and-notifiers-tp2...
Sent from the Drools - User mailing list archive at Nabble.com.
16 years
Disable rules at runtime to make sure they get executed only once
by Malinda Kaushalye
Hi All,
I need to write a set of rules that each get executed only ONCE. However, the conditions are met at different stage of execution as events are coming thru a stream. Therefore I need to disable each rule at different stages.
I was looking for some mechanism to disable a rule after it gets executed. Something like this.
rule "myExecuteOnlyOnceRule"
when
//some condition tat evaluate events
then
this.rule.disable() / disable(drools.getRule())
end
Let me know if you know such a function or a workaround for this issue.
Cheers,
Malinda
16 years
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
16 years
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.
16 years
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
16 years
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
16 years