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
14 years, 9 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
14 years, 9 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
14 years, 9 months
Insert new facts from RHS
by Malinda Kaushalye
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
14 years, 9 months
Drools Guvnor problem after crash..
by Tharakesh Siddalingaiah
Hello,
I am not able to see/edit rules in Drools Guvnor (5.0.0.M5) after JBoss
crash.
We are using SQL Server 2005 for the rules repository.
This was working just fine for over a year now.
After restarting the server, I was not able to see any of the rules.
When I logged into Guvnor It said that repository appears to be new and
asked if I wanted to install the samples.
We restored the database to a previous dump and I was able to see the
rules if I went in through categories.
However, I can't see the rules under the Package view. I also can't build
a package nor export the rules as XML.
Nor can I search for rules from the Find tab.
I have an XML export from a few days ago that looks good but we would
loose the history of rule changes.
Any ideas on how to get our Guvnor working?
thanks,
-tk
Tharakesh Siddalingaiah
Solution Architect
GTO GIS Core Banking - PWM IT US
Deutsche Bank AG
Tel: +1 (410) 895 5275
Mob: +1 (410) 905 2169
tharakesh.siddalingaiah(a)db.com
---
This communication may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this communication
in error) please notify the sender immediately and destroy this
communication. Any unauthorized copying, disclosure or distribution of the
material in this communication is strictly forbidden.
Deutsche Bank does not render legal or tax advice, and the information
contained in this communication should not be regarded as such.
14 years, 9 months
Re: [rules-users] guvnor - dsl rule editor - using ":" in text box
by John Walker
I also have a similar [then] DSL which is trying to set a value. Looks
like:
[then]Set summary to {summary}=... code here ...
As expected, the same problem occurs.
Is there a workaround for these two scenarios?
Can I set a regex on the DSL for the [when] and [then]?
Like:
[when]- and var9 matches {v9:.*}=field9!=null, field9 matches "{v9}"
[then]Set summary to {summary:.*}=... code here ...
I am not very familiar with regex inside the DSL variable placeholders.
I've only just seen this in other forum posts.
Thanks,
John
-----------------------------------------------------------------------
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
14 years, 9 months