Re: [rules-users] Loading facts and memory size limits
by Greg Barton
Do you have rules which relate two arbitrary customers together? If the answer is no (and even a limited yes) then the problem can process customers in parallel. That means you can break the processing down into smaller chunks and you don't need all customers in memory at once.
GreG
On Sep 9, 2010, at 3:27, bellios <carfid(a)gmail.com> wrote:
In my application I would to model the Customers-Sales domain and I thought
that drools could help me to express a set of rules to capture (or execute
on-demand) some "special" customers (e.g. take the customers which not
have/have bought some products of category X in the last 6 months).
To do this i'm loading the last 6 months sales into WM, afterwards on demand
i execute the rules. This process fails due the memory requirements. I
thought that Drools would use an hibernate/JPA/ or an incremental
mechanisms to load and process the facts.
@Swindells, Thomas: Do you think that it's the right approach?
@Michael Anstis-2: I will try to study in deep the event
processing\CEP\streaming methods.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Loading-facts-and-mem...
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 6 months
Loading facts and memory size limits
by bellios
Hi all,
i have read the Documentation and the Drools book. I am developping an
application but i don't understand in my case how i can loading a
1,000,000,000 facts (approx).
At present I load all facts into a StatefulKnowledgeSession with a for-
cycle and I insert them into ksession ("ksession.insert(customer);")
The problem is the out of memory exception due the high memory
requirements of facts.
How i can resolve it? There is another approach to
facts loading into session? Can i integrate the loading with JPA/Hibernate
frameworks?
Thanks in advance for any suggestion,
David
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Loading-facts-and-mem...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Firing Specific rules using KBase and StatefulKnowledgeSession
by Vignesh
Hi,
We are not able to fire specific rules using KBase and
StatefulKnowledgeSession,
//Code snippet
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.fireAllRules(new RuleNameEndsWithAgendaFilter("test"));
If we use the method directly we are getting the below compile time error,
The method fireAllRules(int) in the type StatefulRuleSession is not
applicable for the arguments (RuleNameEndsWithAgendaFilter)
and when we cast it and used the same by
ksession.fireAllRules((AgendaFilter) new
RuleNameEndsWithAgendaFilter("test")); but getting the below exception,
java.lang.ClassCastException: org.drools.base.RuleNameEndsWithAgendaFilter
Same thing we are able to achieve using RuleBase and WorkingMemory as below,
RuleBase ruleBase = agent.getRuleBase();
WorkingMemory wrkMemory = ruleBase.newStatefulSession();
int i=wrkMemory.fireAllRules(new RuleNameEndsWithAgendaFilter("read"));
Any pointers on how to use this functionality for firing specific rules
using KBase and StatefulKnowledgeSession, by filtering out rules based on
rule names. Please help in this regard.
Thanks,
Vignesh
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Firing-Specific-rules...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 6 months
Guvnor connection Drolls API.
by tom ska
Hi,
what I want to do, is to initialise knowledgeBase with package created in
Guvnor. But I don't want to use changeSet.xml. I have my own configuration
file (apache commons configuration), and I want to load all connection's
data from this file. So I have in my config file: Guvnor's URL, and login
and password. I want to load my knowledgeBase in JAVA using this file. Is
this possible? To avoid using changeSet.xml?
Thanks,
tom.
15 years, 6 months
if else implementation in one rule
by Kripa Nathwani
Hello,
I need to implement a functionality as follows:
If an employee belongs to a particular state(MH) for a particular month(Feb) then take an action.
If an employee belongs to the same state(MH) but for different month (non Feb) then take another action.
I can implement it using two different rules(Feb rule and nonFeb rule). BUT if I want to implement it using a single rule is there any provision for the same in Drools?
Similar to an if-then-else statement in java.
Best Regards,
Kripa
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
15 years, 6 months
Keeping track of sessions and their process instances
by Gustavo Tenrreiro
Hi,
I am working on a flow that uses flow events.
I send the event from a rule, and the only way I know to send an event
requires that I know the processId as well as the sessionId. Which
means I need to be able to keep track of both those two values so that
I can later use them to send the event.
So the question is what is the best strategy to keep track of the
sessions and the processes ?
The following is what I do; please comment on it, and feel free to
suggest a better way.
I ve created a class called WorkflowInfo that has two members (
processId, and sessionId )
When I start the process I create a WorkflowInfo, I set the processId,
and the sessionId then I insert it into the working memory:
WorkflowInfo info = new WorkflowInfo();
info.setProcessId(instance.getId());
info.setSessionId(ksession.getId());
ksession.insert(info);
In one of the rules I check for a condition, and when it is met I send
the flow event:
rule "sendEvent"
when
$info : WorkflowInfo()
<something is true>
then
DroolsEventsManager.getInstance().sendEvent($info.getProcessId(),
$info.getSessionId(), "someEvent");
end
Now to send the event this is what I do ( from a java class ):
public void sendEvent(long processId, int sessionId, String eventType)
{
StatefulKnowledgeSession session =
JPAKnowledgeSessionLookup.getInstance().loadSession(sessionId);
try {
SignalEventCommand command = new SignalEventCommand();
command.setProcessInstanceId(processId);
command.setEventType(eventType);
command.setEvent(true);
session.execute(command);
} catch (Exception e) {
Logger.getInstance().error(this.getClass(), e.getMessage());
e.printStackTrace();
}
finally{
session.dispose();
}
}
Does this approach make sense ?
Thanks
15 years, 6 months
Fwd: Artificial Intelligence: Expanding & Broadening Your Skills
by Edson Tirelli
Hey all,
Don't forget to register for Rules Fest 2010. As usual, we are holding a
bootcamp there where we can share experiences between Drools users and
developers. Last year the room was packed full, and we had a great meeting.
Hope to meet you there in October. More details on the e-mail bellow and
on the Drools blog:
http://blog.athico.com/2010/08/dont-forget-rulefest-october-2010.html
Cheers,
Edson
---------- Forwarded message ----------
From: Rules Fest Association <Rules_Fest_Association(a)mail.vresp.com>
Date: 2010/9/8
Subject: Artificial Intelligence: Expanding & Broadening Your Skills
To: tirelli(a)post.com
[image: advertising_3_header1.jpg]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/6e260b...>
September 8, 2010
*Do you want to broaden & sharpen your AI programming skills?*
Join other software programmers, developers, engineers and architects at
Rules Fest 2010
[image: grey_box_top.gif]
Artificial Intelligence is undergoing a quiet renaissance across all
industries, powered by reasoning technologies like rule-engines, inference
engines, and constraint-solvers. Get a practical immersion in these topics
at this year’s Rules Fest conference, to be held in San Jose, CA from
October 11-14, 2010.
Key topics during the 17-session, 3-day conference include:
Reasoning *in Action* Reasoning Methodologies
& Best-Practices Reasoning and Management Reasoning Trends
AI-specific sessions include:
- *Keynote*: The Role of Production Rules in a General Cognitive
Architecture, Professor John Laird, the John L. Tishman Professor of
Engineering at the Artificial Intelligence Laboratory at the University of
Michigan
- Integrating Classic Rule Systems With Modern Scalable
Architectures, Chandra
Mouleeswaran
- Learning by Demonstration Technology for the Masses, Karen Myers
In addition to artificial intelligence, Rules Fest 2010 will address
reasoning, inferencing, and pattern matching technologies that are at the
heart of many solutions to modern, complex computing problems.
For complete conference agenda, abstracts and speakers bios, visit our
website<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/762526...>
[image: grey_box_bottom.gif] *Fee*: * $399.* Register before September
15 and save $50:* $349 early bird special.*
*Discounts for groups and students. *
*[image: RulesFest]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/01f8d5...>Conference
package
*
- 4 nights and 3 days at the historic Dolce Hayes Mansion
Resort<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/d8cb13...>
- A boot cam<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/226b04...>p
of choice
- Continental breakfast and lunch each day
- Discount off from the Rules Fest 2011 conference
- *$999 ($225 savings)*
*Info:*
www.rulesfest.org<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/5c3420...>
[image: RegisterNow]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/232895...>
*Join the Dialog:*
*[image: twitter_logo
2]*<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/2cf336...>
[image: linkedin-in-button
2]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/988010...>
[image: facebook]<http://cts.vresp.com/c/?VisionArtsCommunicat/29b07023ea/4dadcb8b59/79f519...>
Email: info(a)company.com <info(a)rulesfest.org>
------------------------------
Click to view this email in a
browser<http://hosted.verticalresponse.com/756695/29b07023ea/1343038631/4dadcb8b59/>
If you no longer wish to receive these emails, please reply to this message
with "Unsubscribe" in the subject line or simply click on the following
link: Unsubscribe <http://cts.vresp.com/u?29b07023ea/4dadcb8b59/mlpftw>
Click here<http://oi.vresp.com/f2af/v4/send_to_friend.html?ch=29b07023ea&lid=1343038...>to
forward this email to a friend
Rules Fest Association, Inc.
6655 W. Sahara Avenue Suite E-102
Las Vegas, Nevada 89146
Read <http://www.verticalresponse.com/content/pm_policy.html> the
VerticalResponse marketing policy.
[image: Try Email Marketing with VerticalResponse!]
<http://www.verticalresponse.com/landing/ef/?mm//29b07023ea>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
15 years, 6 months
Re: [rules-users] Loading facts and memory size limits
by Greg Barton
Considering that just an Object array of 10 million Objects consumes 115MB of memory, I think loading 1 billion facts will be stretching the limits of the VM all by itself. (and that's java.lang.Object with no fields...)
GreG
On Sep 8, 2010, at 10:31, bellios <carfid(a)gmail.com> wrote:
Hi all,
i have read the Documentation and the Drools book. I am developping an
application but i don't understand in my case how i can loading a
1,000,000,000 facts (approx).
At present I load all facts into a StatefulKnowledgeSession with a for-
cycle and I insert them into ksession ("ksession.insert(customer);")
The problem is the out of memory exception due the high memory
requirements of facts.
How i can resolve it? There is another approach to
facts loading into session? Can i integrate the loading with JPA/Hibernate
frameworks?
Thanks in advance for any suggestion,
David
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Loading-facts-and-mem...
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 6 months
JMS Messenger
by Tina Vießmann
Hi,
I'm using JMS (especially Apache ActiveMQ) in my application. Right
now, I'm manually establishing the JMS connection, extracting my Java
objects from the JMS messages and inserting the objects into the
knowledge base. It's simple without any hype.
Until now, I've always missed the chapter about the JMS Messenger in the
Expert User Guide somehow. Now I've read about it, I'm asking myself if
it can be helpful to me. But based on the short description I can't make
really head or tail of it.
Could someone explain its functionality more detailed to me, please?
Thank you for any help! :)
Tina
15 years, 6 months