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)
16 years, 2 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.
16 years, 2 months
Question on use of Timer node in rule flow
by Alan.Gairey@tessella.com
I'm currently experimenting with including a Timer node within a rule
flow.
My question is: what (if any) runtime state information is persisted by
Drools Flow for a Timer node? I can recreate a session via a call to
JPAKnowledgeService.loadStatefulKnowledgeSession, but if a process
instance was previously on a Timer node, will it start from where it left
off, or will the Timer delay start from the beginning again? For example,
if I have a Timer node with a delay of 7 days, but the application is
stopped / crashes after 6 days, then when I recreate my session, will the
Timer node just wait 1 more day, or will the delay of 7 days start from
scratch?
Thanks in advance for any help,
Alan
16 years, 2 months
Flow and Rules Together - Best practice question
by J Michael Dean
Have been working solely with rules and have now created an overall rule flow that has enabled me to eliminate parts of the conditions of many rules, because the rules are in rule flow groups. For example, if the glucose value must be below 40 to get into a rule flow group called "Below 40", then I do not need to check that the glucose is below 40 in the condition of every rule in the group.
I have noticed, however, that when a fact is inserted, it appears to activate all rules for which the conditions match, even though the majority of the rules are not in the rule flow group. I am interpreting this as simply activating everything applicable, taking advantage of the Rete, and then the activated rules are filtered by rule flow group. Is this a correct interpretation?
The corollary question is whether I am using best practice by eliminating "redundant" conditions from my rules, or whether I should include in those conditions the constraints that were determining whether the rule flow group becomes active. If this scaled up to one to two thousand rules, would the activations and filtering be more costly?
Thanks for any advice. My colleagues and I were very happy to eliminate the redundant conditions because it makes our rules look simpler, but now concerned may be going down wrong track.
- Mike
16 years, 2 months
Re: [rules-users] rules-users Digest, Vol 39, Issue 45
by Nilima R
Hi
In drools in deployment we get the below link.
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/xxxx...
We need to include this in properties file in application wherein this URL
is mentioned.
How can one protect unauthorized access to this URL as the whole set of
rules can be viewed for this .
Nilima
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
From:
rules-users-request(a)lists.jboss.org
To:
rules-users(a)lists.jboss.org
Date:
02/17/2010 10:14 PM
Subject:
rules-users Digest, Vol 39, Issue 45
Sent by:
rules-users-bounces(a)lists.jboss.org
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Negating a result (Wolfgang Laun)
2. Re: Negating a result (djb)
3. Re: Negating a result (Wolfgang Laun)
4. Re: guvnor - dsl rule editor - using ":" in text box
(Toni Rikkola)
5. Re: getWorkingMemoryEntryPoint returns NULL (Wolfgang Laun)
6. Insert new facts from RHS (Malinda Kaushalye)
7. Re: Insert new facts from RHS (Mauricio Salatino)
8. Re: Insert new facts from RHS (Enda J Diggins)
----------------------------------------------------------------------
Message: 1
Date: Wed, 17 Feb 2010 09:48:50 +0100
From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
Subject: Re: [rules-users] Negating a result
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<17de7ee81002170048j6898203br6a73e2e2962cbc79(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Please be more specfic. If your field is called "foo", then
should have a method in the class representing
your fact, such as:
boolean getFoo(){
return <condition> ? ! (<expression>) : <expression>;
}
Basically, <condition> could be a global parameter (public static final)
or a static or regular method call. <expression> could depend on other
attribute values, and so on.
You can then write your CEs with a test such as
foo == true
But I think this is closely related with that other question you
have posted.
-W
On Wed, Feb 17, 2010 at 9:32 AM, djb <dbrownell83(a)hotmail.com> wrote:
>
> Hi Wolfgang,
>
> Sure, I know de Morgan's laws, but I'm not asking how one can negate a
> condition...
>
> I'm asking how one can either negate or not negate, based on a test...
and
> whether I'm going to have to split my spreadsheet/rule-template into 2,
> (i.e. 1 for "may not be" rules, 1 for "must be" rules).
>
> My spreadsheet has a field that in Java would be expressed as field ?
> !finalResult : finalResult
>
> But in DRL, it seems the lack of a ternary operator means I have to
split
> my
> rule-set, and I'm just checking if this is the case.
>
> -Daniel
>
> --
> View this message in context:
> http://n3.nabble.com/Negating-a-result-tp212559p212656.html
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100217/18c1914...
------------------------------
Message: 2
Date: Wed, 17 Feb 2010 02:02:08 -0800 (PST)
From: djb <dbrownell83(a)hotmail.com>
Subject: Re: [rules-users] Negating a result
To: rules-users(a)lists.jboss.org
Message-ID: <1266400928420-212797.post(a)n3.nabble.com>
Content-Type: text/plain; charset=us-ascii
Well the thing is, it's not just one condition - it's the combination of
all
my rule's conditions.
And my rules have about 7 conditions, none of which are mandatory.
And that is actually the source of all my problems: that the conditions
are
optional.
If I set up a few logical relationships, there is nothing specific I am
testing on, which gives a single expression I can test in a function. In
procedural programming, I check each of the 7 conditions optionally, and
then I apply my ternary operator to the final result. But here I can't do
that, because the condition is made up of all the little conditions that
may
or may not be applicable.
PS.
Ok, so I see from the other thread that a rule template is meant to place
whatever text you give it, like a text pre-processor. I'll see if that is
correct, thanks. I thought it might not be, because if you provide a
blank
cell, it deletes your entire condition, instead of providing a "" or a
null,
like you'd expect from a text pre-processor.
--
View this message in context:
http://n3.nabble.com/Negating-a-result-tp212559p212797.html
Sent from the Drools - User mailing list archive at Nabble.com.
------------------------------
Message: 3
Date: Wed, 17 Feb 2010 11:33:14 +0100
From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
Subject: Re: [rules-users] Negating a result
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<17de7ee81002170233s62e0353fs50d439c532c75e82(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
On Wed, Feb 17, 2010 at 11:02 AM, djb <dbrownell83(a)hotmail.com> wrote:
>
> Ok, so I see from the other thread that a rule template is meant to
place
> whatever text you give it, like a text pre-processor. I'll see if that
is
> correct, thanks.
I implemented this, so I hope I still know what I did. :-)
> I thought it might not be, because if you provide a blank
> cell, it deletes your entire condition, instead of providing a "" or a
> null,
> like you'd expect from a text pre-processor.
>
The idea of the interface for generating rules from object collection
is to avoid the constraints of spreadsheet translation.
-W
> --
> View this message in context:
> http://n3.nabble.com/Negating-a-result-tp212559p212797.html
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100217/ea6ec91...
------------------------------
Message: 4
Date: Wed, 17 Feb 2010 12:33:10 +0200
From: Toni Rikkola <trikkola(a)redhat.com>
Subject: Re: [rules-users] guvnor - dsl rule editor - using ":" in
text box
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID: <4B7BC5E6.6040704(a)redhat.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Tested it and this is a bug.
I made a Jira for it so you can follow it.
https://jira.jboss.org/jira/browse/GUVNOR-505
Toni
John Walker wrote:
> All,
>
> I have a DSL sentence that looks like this:
> [when]- and var9 matches {v9}=field9!=null, field9 matches "{v9}"
>
> When using the Guvnor guided rule editor, I add the "- and var9
> matches {v9}" DSL sentence to the rule, giving me a WHEN condition
> like this:
> - and var9 matches [text box]
>
> I want to put a URL in the text box, but anytime I use a value
> containing a colon":",
> I get a popup box with error message "The value [some value with a
> colon] is not valid for this field"
>
> Example:
> DSL in rule, using guvnor guided editor: "- and var9 matches
> [http://google.com]"
> Popup error message: "The value http://google.com is not valid for
> this field"
>
> What needs to happen to allow a value with a colon? I did not have
> this problem with drools4 and JBRMS.
>
> Thanks,
> John
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
------------------------------
Message: 5
Date: Wed, 17 Feb 2010 13:59:03 +0100
From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
Subject: Re: [rules-users] getWorkingMemoryEntryPoint returns NULL
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<17de7ee81002170459y5c64fe34p2922245f510decfc(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Do you use "global" in your rules? This would be the "declaration" of an
entry point.
Also, KnowledgeSessionConfiguration should be passed to the method call
creating a session, which I don't see in your code.
-W
On Wed, Feb 17, 2010 at 2:16 AM, Malinda Kaushalye
<kaushalye(a)yahoo.com>wrote:
> Dear All,
> It appears to be that the getWorkingMemoryEntryPoint() method returns
NULL
> in my code given below.
> Note that EventProcessingOption = STREAM and ClockType = "realtime" if
that
> is of any importance.
> Cheers,
> Malinda
>
> public class EventKnowledgeBase { private KnowledgeBase kbase = null;
> private StatefulKnowledgeSession ksession = null; private
> WorkingMemoryEntryPoint globalStream = null;
> public EventKnowledgeBase() throws Exception {
> super();
> kbase = readKnowledgeBase();
> ksession = kbase.newStatefulKnowledgeSession();
> KnowledgeBaseConfiguration config =
> KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
> config.setOption( EventProcessingOption.STREAM );
> KnowledgeSessionConfiguration kbSessionConfig =
> KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
> kbSessionConfig.setOption( ClockTypeOption.get("realtime") );
> globalStream = ksession.getWorkingMemoryEntryPoint( "global" );
> if(null == globalStream){
> System.out.println("WorkingMemoryEntryPoint is Null"); //YEAH..! IT
> RETURNS NULL
> }
> }
>
>
> }
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100217/23fa4cd...
------------------------------
Message: 6
Date: Wed, 17 Feb 2010 08:25:37 -0800 (PST)
From: Malinda Kaushalye <kaushalye(a)yahoo.com>
Subject: [rules-users] Insert new facts from RHS
To: rules-users(a)lists.jboss.org
Message-ID: <817565.1542.qm(a)web56503.mail.re3.yahoo.com>
Content-Type: text/plain; charset=utf-8
Hi All,
How do I insert new facts/events to the working memory from RHS?
rule "myrule"
when
//Some condition
then
//Create and Insert some new events/facts to the working memory
end
Cheers,
Malinda
------------------------------
Message: 7
Date: Wed, 17 Feb 2010 13:35:40 -0300
From: Mauricio Salatino <salaboy(a)gmail.com>
Subject: Re: [rules-users] Insert new facts from RHS
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<efac615a1002170835q3ee9c0d8o8d1efada0ef1e310(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
just calling
insert(new Person());
in the RHS
On Wed, Feb 17, 2010 at 1:25 PM, Malinda Kaushalye
<kaushalye(a)yahoo.com>wrote:
> Hi All,
> How do I insert new facts/events to the working memory from RHS?
>
> rule "myrule"
> when
> //Some condition
> then
>
> //Create and Insert some new events/facts to the working memory
> end
>
> Cheers,
> Malinda
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100217/f380292...
------------------------------
Message: 8
Date: Wed, 17 Feb 2010 16:38:35 +0000
From: Enda J Diggins <ejdiggins(a)gmail.com>
Subject: Re: [rules-users] Insert new facts from RHS
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<55587e551002170838u27e625efqa41ca3973564c91(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Malinda,
rule "myrule"
when
//some condition
then
insert(new Object());
// or
Variable var = new Variable();
insert(var);
end
On Wed, Feb 17, 2010 at 4:25 PM, Malinda Kaushalye
<kaushalye(a)yahoo.com>wrote:
> Hi All,
> How do I insert new facts/events to the working memory from RHS?
>
> rule "myrule"
> when
> //Some condition
> then
>
> //Create and Insert some new events/facts to the working memory
> end
>
> Cheers,
> Malinda
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
Enda J Diggins
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.jboss.org/pipermail/rules-users/attachments/20100217/f4adb2c...
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 39, Issue 45
*******************************************
=====-----=====-----=====
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, 2 months