Setting Globals inside Rules
by Gary Napier
Hi all,
I have common code that can run a number of different rule base(s) and
so far each of the different rule bases have utilized common Global
variables (lists of regular expressions and runtime options)
However a new rule base will require additional /different globals to be
set and i do not want to change the code that invokes the engine and
compiles the rule base.
Is it possible, by way of an example, to have a rule execute upon rule
base initialization and populate a series of global variables? Ideally
this would come from a settings config file in the same directory as the
rule .drl files.
Thanks
Gary
16 years, 1 month
M2: What Revision?
by Steve Nunez
Gentlemen,
What revision was finally 'blessed' as M2? We'd like to build
ourselves and begin testing sooner rather than later.
Regards,
- SteveN
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
16 years, 1 month
Synchronizing StatefulSession
by ganesh.p
Hi,
Consider a scenario where multiple threads continuously assert facts using
StatefulSession.insert() method.
public class RulesManager {
private RuleBase ruleBase;
private StatefulSession session;
public RulesManager() {
ruleBase = RuleBaseFactory.newRuleBase();
session = ruleBase.newStatefulSession();
}
public void fireRules(Object fact) {
session.insert(fact);
session.fireAllRules();
}
}
In this scenario, do we need to synchronize StatefulSession for thread
safety?
--
View this message in context: http://www.nabble.com/Synchronizing-StatefulSession-tp19740667p19740667.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month
Defining fallback rules
by Marcus Ilgner
Hi all,
I'm currently puzzled on how to implement a sort of fallback rule. In
my scenario I have a couple of articles and payments related to those
articles. Now I need to distribute royalties to the authors of these
articles. There's a common business logic which says "distribute X
percent for articles of type T, Y percent for articles of type S and Z
percent for all other articles".
At first, my approach was to write the rules like this (omitting a
rule for type 'S' for the sake of brevity):
rule1
activation-group "article1"
salience 100
when
$article : Article(type == 'T')
$payment : Payment( article==$article )
then
account(x%)
end
rule3
activation-group "article1"
salience 0
when
$article : Article()
$payment : Payment( article==$article )
then
account(z%)
end
However, I quickly found out that the use of activation-group will
then only consider all articles of type T and ignore all other
fact-combinations. Retracting payments from the WM is also not
feasible since there may be other rules that should work on them.
I also cannot write the last rule as Article( type != 'T', type != 'S'
etc) since new article types may be added later on and it would not be
manageable to update all previously written rules (which may very well
number in thousands in the future).
Now I'm a bit stuck on this issue and would welcome any hints.
Best regards
Marcus
16 years, 1 month
memory issue when listening to market data
by Cheng, Ping
All,
I wrote a server which listens to the market data and generates alerts
based on some conditions.
It listens to about 300 symbols and contains 30 simple rules. It works
fine when the market is quiet. It uses about 500 M in memory and there
is no big difference between reports from top and jconsole. When market
is busy, memory displayed in jconsole is still ok, but top reports much
more memory and it did not come down at all. Sometimes it could reach
50G when it's a crazy day.
I used jmap to check the memory map and it looks fine from java view, I
wonder if drools hold something when it's very busy? What is supposed to
happen if drools could not handle the work load?
Thanks for your help.
-Ping
-----------------------------------------
The information contained in the linked e-mail transmission and any attachments may be
privileged and confidential and is intended only for the use of the person(s) named in the
linked e-mail transmission. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you should not review,
disseminate, distribute or duplicate this e-mail transmission or any attachments . If you
are not the intended recipient, please contact the sender immediately by reply e-mail and
destroy all copies of the original message. We do not accept account orders and/or
instructions related to AllianceBernstein products or services by e-mail, and therefore will
not be responsible for carrying out such orders and/or instructions. The linked e-mail
transmission and any attachments are provided for informational purposes only and should not
be construed in any manner as any solicitation or offer to buy or sell any investment
opportunities or any related financial instruments and should not be construed in any manner
as a public offer of any investment opportunities or any related financial instruments. If
you, as the intended recipient of the linked e-mail transmission, the purpose of which is to
inform and update our clients, prospects and consultants of developments relating to our
services and products, would not like to receive further e-mail correspondence from the
sender, please "reply" to the sender indicating your wishes. Although we attempt to sweep
e-mail and attachments for viruses, we will not be liable for any damages arising from the
alteration of the contents of this linked e-mail transmission and any attachments by a third
party or as a result of any virus being passed on.
Please note:
Trading instructions sent electronically to Bernstein shall not be deemed accepted until a
representative of Bernstein acknowledges receipt electronically or by telephone. Comments in
the linked e-mail transmission and any attachments are part of a larger body of investment
analysis. For our research reports, which contain information that may be used to support
investment decisions, and disclosures, see our website at www.bernsteinresearch.com.
16 years, 1 month
Re[rules-users] trieving LHS & RHS of a rule
by Sangrish
Hi
I have to extract LHS and RHS of a rule, that is, the individual
conditions, attributes used in them.
Is there any way of getting his fine grained information. Given a set of
rules I need to decipher the dependencies among them. For example, attribues
used in LHS of a rule might be set in the RHS of another rule.
I have been able to get Rule objects through Package class and can get rule
features like ruleFlowGroup, etc.
Thanks
Siddharth
--
View this message in context: http://www.nabble.com/Retrieving-LHS---RHS-of-a-rule-tp19728236p19728236....
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month
Re: [rules-users] citation tracking, Jess rule language, & export to sourceforge
by David Pautler
> > David Pautler wrote:
> > I'm evaluating Drools and other RMSs, looking for one that provides
> > the following features:
> >
> > 1) Citation tracking. I need to note what articles or scenarios
> > motivated a rule, and be able to provide a short description of how
> > the rule supports each. This goes beyond commenting because I need to
> > have access to a list of all articles and scenarios used and be able
> > to jump to the rules that hang from them.
>
> Mark Proctor:
> Not quite sure what you mean, this is an addition you want to the rule
> language itself? Can you provide more details, maybe we can help you
> work on this.
I'm not sure if the feature belongs in the rule language or only in a RMS.
Here's a description of how it would be used:
1) When creating a rule in an IDE, there would be an option to indicate
the source of the rule. Specifically, there would be a pulldown menu of
article titles previously used as sources, plus a way of indicating the
page range within the article.
2) In addition to specifying the source, the widget would allow entering
a text description. For example, the description might indicate how the
syntax of the original ruleset was changed to accomodate one's own syntax.
3) As a ruleset is maintained, and one finds that rules need to be
altered to fit new-found scenarios, one would want to append a new
source (article or scenario) to the ones already listed for a rule. The
history of sources and descriptions would really help avoid mistakes
such as changing a rule to fit a new case but breaking it for older cases.
4) Whenever one wants to write a publication about the ruleset, the
source histories would help a great deal in describing the intellectual
history of the ruleset, not to mention in generating the bibliography.
Is this the sort of detail you were looking for?
> > 2) Jess rule language. Our team has a symbolic AI background, and
> > Drools' language is non-intuitive to us. It appears that Drools is
> > built on Jess, and Jess' language would work much better for us. Is
> > there a way to use Jess' language, including intellisense support?
>
> Drools is not built on Jess or related to Jess in anyway,
I guessed that it was, due to listing the Jess book in your bibliography
of the overview page, and there was no explanation of the relation of it
to Drools.
> other than
> that we all have our own implementations of the Rete algorithm and have
> followed many of the features implemented in Clips, which itself was
> derived from ART. The Drools DRL language itself was designed as a more
> intuitive and less verbose language, this becomes increasinly important
> as you start to add more complex syntax which becomes harder to read
> with a lisp approach. I think most people in here would agree that the
> Drools DRL approach is an improvement over the lisp approach of
> clips/jess - apart from the die hard lisp fans.
I'm not a die-hard Lisp fan. The CLIPS/Jess language style is just more
similar to the way most people write predicate calculus formulas.
> That said I have an experimental project to provide some level of clips
> support. See this blog for detalis:
> http://blog.athico.com/search/label/Clips
This looks very promising for us.
> Drools was designed from the start to work with pojos, Jess has an
> internal data structure that the pojos must be copied into. For this
> reason our performance compared to Jess when working with pojos is
> atleast double. Drools 5.0 also has a new more robust Rete algorithm,
> that is not subject to inconsistencies affecting modify and retract, we
> call this assymetrical Rete, rather than Jess' symmetrical Rete. Further
> to this our Rete supports partitioning for parallel evaluation, which
> was needed for our CEP work.
This performance note is great info to have. If you have more details on
this "inconsistency affecting modify and retract", I'd like to hear more,
too.
> > 3) Export to sourceforge. Our deployments involve exporting the
> > rulebase and associated citation tracking to sourceforge or google
> > code. That is, we want to deploy text rather than binaries. Is there a
> > better way to do this than a simple db export?
> >
> > I've checked the user manuals and list archives for each of these
> > questions but wasn't able to answer them for myself.
>
> Again not really sure what you are discussing, wouldn't just putting the
> .drl up at sourceforce achieve this?
I'm not sure of all that goes into these DRL files...it appears that
they use xml to describe the entire ruleset of a package. This would
work fine for us, although we would like to have a way of associating
them with the "source histories" I described above -- perhaps by using
the same filename for both, in the same dir, but a different extension
for the history.
> Btw if you do continue your research on Drools, I would encourage to put
> your details and your research up on the Drools Research Network page,
We'd be happy to do so.
> and also join the mailing list
I'm already on the users list; I didn't see a research-specific one.
16 years, 1 month
citation tracking, Jess rule language, & export to sourceforge
by David Pautler
I'm evaluating Drools and other RMSs, looking for one that provides the
following features:
1) Citation tracking. I need to note what articles or scenarios
motivated a rule, and be able to provide a short description of how the
rule supports each. This goes beyond commenting because I need to have
access to a list of all articles and scenarios used and be able to jump
to the rules that hang from them.
2) Jess rule language. Our team has a symbolic AI background, and
Drools' language is non-intuitive to us. It appears that Drools is built
on Jess, and Jess' language would work much better for us. Is there a
way to use Jess' language, including intellisense support?
3) Export to sourceforge. Our deployments involve exporting the rulebase
and associated citation tracking to sourceforge or google code. That is,
we want to deploy text rather than binaries. Is there a better way to do
this than a simple db export?
I've checked the user manuals and list archives for each of these
questions but wasn't able to answer them for myself.
David
16 years, 2 months