Drools scalability
by james corrigan
Hi All,
Can one session be shared amongst multiple threads? In the book Drools JBoss
Rules 5.0 Developer's Guide it says that sessions cannot be shared as they
contain state which i understand but in chapter 12 they say that "Drools
supports parallel execution mode. One session can be executed by multiple
threads." using Knowledge partitioning what exactly does this mean? Thanks
in advance.
Kind regards,
James.
14 years, 3 months
Drools Fusion Performance and RETE algorithm
by Orlando Ricardo Da Silva Costa
Hi all
Looking at "Drools JBoss Rules 5 0 Developer's guide" it addresses the
Fusion component at page 134, stating:
"This problem cannot be solved by the standard Drools rule engine. The
volume of events is huge and it happens asynchronously. If we simply
inserted them into the knowledge session, we would soon run out of
memory. While the Rete algorithm behind Drools doesn't have any
theoretical limitation on number of objects in the session, we could
use the processing power more wisely. Drools Fusion is the right
candidate for this kind of task."
Ok, but my question is if this is enough, because I would guess that
Fusion could be used to derived a more complex/rich event from the
stream of events, and afterwards that complex event would be inserted
in Working Memory (but not the flow of events that have generated the
more complex event), thus reducing RETE algorithm processing. But
since in our case every event will most certainly fire a rule, I am
not sure about Fusion's usage.
This is because our project is more a kind of
Event-Trigger-Rule/Action system, meaning we have a high volume of
incoming events (say more than 5000/minute), but each of the events
will have to trigger a rule (and usually a rule is more or less a
complex action, invoking DB operations and data structures
manipulation).
So, by using Fusion entry-points, would that be different than just
sending the events as "normal" facts to Working Memory, or by dividing
this in entry-points( or so called streams) we would have benefits in
the RETE processing (I am assuming Fusion also uses RETE someway)?
Best regards
Orlando.
PS-Does anyone know where can I find more info on the coupling of
Drools Expert and Fusion?
14 years, 3 months
Drools Scalability
by Orlando Costa
Hi all
I have been looking at Drools (Expert, Fusion and Flow) to see how
feasible it is to use it in our project. We have requirements for
scalability:
1) system must be vertically scalable
2) system must be horizontally scalable
I guess for 1), we could use KnowledgeBase partitioning, but for 2) I
have no idea...has someone been looking at this, does it make sense to
have a rule engine horizontally scalable at all?
Br
Orlando.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Scalability-tp...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months
Accumulate in Drools
by Manav
Hi,
I am trying my hand at the accumulate function in Drools 5.x but the drl fails
to compile.
Not sure what's wrong with it. Please help.
This is the sample that i am working with
rule "Test Accumulate Function"
when
$p : ProductType ($name : name)
$min_score : Number ()
from accumulate (Client (productTypeExperience.keySet contains $name,
$score :
((ExperienceLevel)productTypeExperience[$name]).value()),
min ($score))
then
System.out.println ("$min_score" + $min_score);
end
Regards,
Manav
14 years, 3 months
Adding two numbers
by Hehl, Thomas
I have two properties on my class that I'd like to add together and
compare results. I'm trying:
when
stub:PaymentStub(daysJuror + daysPanel > 0)
But this throws an error. Either daysJuror or daysPanel work, but adding
them together doesn't. Isn't there a way to do this?
Thanks!
Thom Hehl
Java Applications Architect
Public Safety & Justice
Affiliated Computer Services, Inc.
A Xerox Company
1733 Harrodsburg Road
Lexington, KY 40504-3617
Tel 859.277.8800 x 144
Fax 859.277.2300
14 years, 3 months
KnowledgeAgent detects resource changes and updates but nothing changes
by Tina Vießmann
Hi,
I've set up a knowledge agent the change set configuration. While
running the application I'm changing the rules file and the agent
detects the change and rebuidls the knowledge base. But after that the
output that should have changed didn't change.
Thank you! :)
Greetings
Tina
Here are the code snippets:
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("AITS CEP Engine Agent");
kagent.applyChangeSet(ResourceFactory.newClassPathResource("changeset.xml"));
KnowledgeBase knowledgeBase = kagent.getKnowledgeBase();
session = knowledgeBase.newStatefulKnowledgeSession();
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMSchema-instance'
xs:schmeaLocation='http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd'
>
<add>
<resource source='classpath:testRule.drl' type='DRL' />
</add>
</change-set>
The status information put out to the console are:
[2010:08:230 16:08:93:debug] ResourceChangeScanner attempt to scan 1
resources
[2010:08:230 16:08:93:debug] ResourceChangeScanner modified
resource=[ClassPathResource path='testRule.drl'] : 1282139449234 :
1282141364812
[2010:08:230 16:08:93:debug] ResourceChangeNotification received
ChangeSet notification
[2010:08:230 16:08:93:debug] ResourceChangeScanner thread is waiting for
60 seconds.
[2010:08:230 16:08:93:debug] ResourceChangeNotification processing ChangeSet
[2010:08:230 16:08:93:debug] ResourceChangeNotification ChangeSet
modified resource=[ClassPathResource path='testRule.drl'] for
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31
[2010:08:230 16:08:93:debug] KnowledgeAgent received ChangeSet changed
notification
[2010:08:230 16:08:93:info] KnowledgeAgent applying ChangeSet
[2010:08:230 16:08:93:debug] KnowledgeAgent rebuilding KnowledgeBase
using ChangeSet
[2010:08:230 16:08:109:debug] ResourceChangeNotification thread is
waiting for queue update
[2010:08:230 16:08:218:debug] KnowledgeAgent obtaining pkg
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Insert Watcher Into Knowledge Base,
agendaGroup=MAIN, salience=0, no-loop=false]
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=[Rule name=Add Event to Watcher Set,
agendaGroup=MAIN, salience=0, no-loop=false]
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.TypeDeclaration@1bed3d1
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:218:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.TypeDeclaration@1f528ab
[2010:08:230 16:08:218:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.Function@1bb9829
[2010:08:230 16:08:234:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent mapping
resource=[ClassPathResource path='testRule.drl'] to
KnowledgeDefinition=org.drools.rule.Function@eb840f
[2010:08:230 16:08:234:debug] KnowledgeAgent notifier subscribing to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@1acfa31 to
resource=[ClassPathResource path='testRule.drl']
[2010:08:230 16:08:234:debug] KnowledgeAgent adding
KnowledgeDefinitionsPackage net.eads.astrium.aits.cep.rules
[2010:08:230 16:08:250:info] KnowledgeAgent new KnowledgeBase now built
and in use
[2010:08:230 16:08:250:debug] KnowledgeAgent finished rebuilding
KnowledgeBase using ChangeSet
14 years, 3 months
Spring configuration v5.1.0.M2 V/s v5.1.0
by KiranP
Hello Everybody,
I was dazelled by reading the post
http://drools-java-rules-engine.46999.n3.nabble.com/5-1-0-CR1-Drools-Spri...
Drools-Spring-Configuration-Changed?
I was working with Drools v5.1.0.M2 which had around 50 different Processes
and Simple configuration as :
"Configure EMF and Transaction Manager pass them to JPAKnowledgeServiceBean
and directly use it into
my own Services - ProcessService.startprocess(); and
ProcessService.resumeService();"
this services in turn were calling simple API Provided by :
JPAKnowledgeServiceBean
createNew...();
load...( id ) ;
and the workItemHandler to Task Assignment was taken care by the
Configuration File - drools.session.conf
now i want to upgrade to Drools v5.1.0
but for that i have to create 50 different Spring Configurations one for
each process and use a kstore (its not as easy as it looks)
then again i cannot have a single service method like
ProcessService.startProcess(processId);
instead i have to use ProcessService.startProcessABCProcess(); then
ProcessService.startXYZProcess(processId); and so on for all the 50
processes
more over this we also have to re-create the Environment,kbase and
configuration for each process start and resume......
Dont you think that the M2 version API's were more easy and effective???????
Suggestions and Work-out are very much welcome.....
-----
Keep Working >>
KiranP
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Spring-configuration-...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months
Rule template shortcut needed
by djb
Hi there,
My question is related to the ability to remove criterion in a rule template
by a cunning commenting trick so that if the variable @{VAR} is blank, the
line will be blank. Wolfgang wrote the code, I believe.
I've got a situation where I've got DB rows where i've got:
TYPE | CODE | TYPE2 | CODE2_FROM | CODE2_TO
there are 17 types. So it lets us have rules like
Type U code 123 cannot be charged with Type V codes 234 to 236.
I need the rules to compare the correct property, but I don't want to lose
the advantage of the RETE algorithm by using a getValue("type1") function.
I see one solution:
2. Make a template with 17 + 17 + 17 = 51 columns, where each one uses the
// @{VAR} trick.
Is there a better way? Or, should I just do getValue("type")?
Thanks
Daniel
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Rule-template-shortcu...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months