Accepted idiom for binding variable to restriction?
by Laird Nelson
I have a fact that is inserted into my rule base. It is a Response.
A Response has a Question that it is a response to. At the moment,
the Question itself is not separately inserted into the knowledge
base. I would ideally like to keep it this way.
What's the best approach for binding variables to both the Response
and its associated Question?
That is, if the Question were inserted, it would be relatively easy:
when
$question : Question( )
$response : Response( question == $question )
...but I'm finding myself somewhat confused how to "extract" a
Question out of a Response, particularly when, say, I want to "select"
only Responses whose associated Question IDs are "XYZ":
when
$response : Response( $question : question.ID == "XYZ" ) // boy
howdy does this seem wrong
Is the easiest thing to do here to add a second rule that just inserts
the questions:
when
$response : Response
then
insert($response.getQuestion())
end
...? I would love to stay away from this if I could.
Thanks,
Laird
15 years, 9 months
Re: [rules-users] Firing a rule if at least its two conditions are satified
by Greg Barton
This will not work. Rules will not predictably react to changes in global variables. Use an object in working memory.
GreG
On Jun 3, 2010, at 7:15, "PAYET, Manuel" <manuel.payet(a)capgemini.com> wrote:
If I were you, I'd use something like
Global java.lang.Integer cnt;
Rule "before everything"
Salience 10
When
Eval(true)
Then
Cnt=0
End
Rule "condition A"
When
condition A
Then
cnt=cnt+1;
End
Rule "condition B"
When
condition B
Then
cnt=cnt+1;
End
Rule "condition C"
When
condition B
Then
cnt=cnt+1;
End
Rule "action 1, after everything"
Salience -10
When
eval(cnt>=2)
Then
execute action 1
End
Of course, if you change the fact, you'll probably have to think about things like lock-on-active to increment only one time the cnt variable
-----Message d'origine-----
De : rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] De la part de skasab2s
Envoyé : jeudi 3 juin 2010 14:04
À : rules-users(a)lists.jboss.org
Objet : [rules-users] Firing a rule if at least its two conditions are satified
Hello,
we are using Drools in our company. We have a rule with three conditions in this format:
when
Condition A
Condition B
Condition C
then
execute Action 1
Now we have a situation, in which the rule should fire if AT LEAST two of the three conditions are satisfied. Do you know how to implement this? Any ideas or hints?
Many thanks and regards!
skasab2s.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Firing-a-rule-if-at-l...
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
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this message.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 9 months
Error reading brl files in eclipse
by Fnu Mahalakshmi
Hi,
I know this is repeated again but I tried the solution mentioned in the previous posts and it doesn't work.
When I created a guided rule in eclipse, I get blank dropdowns when choosing the facts.
I added the jar file for the classes as an external reference
I also added a .package file to the directory where my rules are located. The package file contains import statements of the classes.
I also added the required classes in the same directory.
But nothing seems to work.
If I import my .brl rule from the guvnor repository I am unable to open it. Gives me an error.
I tried reading it in a text editor and shows me the correct xml format.
Please help!!!
Thank you.
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
15 years, 9 months
Using pipelines
by Swindells, Thomas
I've been trying to learn how to use pipelines to execute some rules.
I've had a look at the JaxbSimpleJmsMessengerTest as that seemed a good place to start and copy the code from (using drools 5.0.1).
However running the test doesn't seem to actually run any of the rules - I've tried adding println's but they don't appear, nor do the globals appear to get populated.
What am I missing?
Thomas
________________________________
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
15 years, 9 months
Drools Flow: Validation Chain Approach
by tolitius
Hey Drools Flow Crowd,
Would appreciate your thoughts on:
Validation One Node
||
\/
Validation Two Node
||
\/
Validation Three Node
||
\/
Validation Four Node
...
...
If any errors are found at any validation node, the process should
terminate with proper logging, etc..
What would be your approach of a clean way to do it in order to avoid
cluttering the process definition with a splitter after individual
"Validation XYZ Node":
Validation One Node
||
\/
SPLITTER => Finalize => End ( or Fault node, which is
as dirty )
||
\/
Validation Two Node
||
\/
SPLITTER => Finalize => End
||
\/
Validation Three Node
||
\/
SPLITTER => Finalize => End
||
\/
Validation Four Node
...
...
Thanks for your input,
/Anatoly
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Validatio...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Re: [rules-users] rules-users Digest, Vol 43, Issue 7
by Fnu Mahalakshmi
Hi,
Thanks a lot. I will try it out.
I had one more doubt. Is it anyway possible to pass the data I want to test my rules against in the guvnor editor itself??
I am using a text document as the input data set.
Thanks a ton!
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of rules-users-request(a)lists.jboss.org
Sent: Wednesday, June 02, 2010 12:00 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 43, Issue 7
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: Doubt of object referencing in creating rules
(Esteban Aliverti)
----------------------------------------------------------------------
Message: 1
Date: Wed, 2 Jun 2010 11:59:35 -0300
From: Esteban Aliverti <esteban.aliverti(a)gmail.com>
Subject: Re: [rules-users] Doubt of object referencing in creating
rules
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<AANLkTikTWWpjlxYsuqlLLOjS8Kz1S_skNwVT5tRYN6lL(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
You could do something like this:
rule "something"
when
$c: Customer (name = "XX")
then
$c.getSales().setType("A");
$c.getSales().setId(1);
end
Did you read this?:
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...
<http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...>
Best,
On Tue, Jun 1, 2010 at 11:37 AM, Fnu Mahalakshmi <FMahalakshmi(a)nyx.com>wrote:
> Hi,
>
> Can anyone tell me how I could deal with complex object referencing while
> creating rules?
> I have:
> Class Customer{
> String name;
> Sale sales;
> ..
> }
>
> When I create my rules:
> When customer.name = XXX
> Then sales.type = A
> sales.id = 1
>
>
> Above is what I want to do.
> I have 2 classes: Customer and sales.
> How could I effectively depict my rules to do the above??
>
> Please help.
>
> Thank you.
>
> Please consider the environment before printing this email.
>
> Visit our website at http://www.nyse.com
>
> ****************************************************
>
> Note: The information contained in this message and any attachment to it
> is privileged, confidential and protected from disclosure. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, please notify the sender immediately by replying to
> the message, and please delete it from your system. Thank you. NYSE
> Euronext.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
15 years, 9 months
Doubt of object referencing in creating rules
by Fnu Mahalakshmi
Hi,
Can anyone tell me how I could deal with complex object referencing while creating rules?
I have:
Class Customer{
String name;
Sale sales;
..
}
When I create my rules:
When customer.name = XXX
Then sales.type = A
sales.id = 1
Above is what I want to do.
I have 2 classes: Customer and sales.
How could I effectively depict my rules to do the above??
Please help.
Thank you.
Please consider the environment before printing this email.
Visit our website at http://www.nyse.com
****************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
15 years, 9 months
Keeping Flows in Guvnor
by tolitius
Need to host all the flows ( process definitions ) in Guvnor as pre-built
knowledge packages.
I heard that it works out of the box, but other people say it is a "desired"
functionality, and it does not really yet implemented to work.
So what is it in reality? I guess this is a question more to Esteban, but
jump in if you are sure.
Thank you,
/Anatoly
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Keeping-Flows-in-Guvn...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months
Re: [rules-users] Drools 5.0.1 in eclipse having memory issue
by LokR
Hi,
Actually, I'm not sure about where the error comes from, so, I'll tell for
two possibilities:
1)Eclipse itself is making a OutOfMemoryError
2)when you run you application using rules, you have a outOfMemoryError
1)Eclipse itself is maling a OutOfMemoryError
-go in your eclipse installation folder
-open the file name eclipse.ini
-replace -Xmx512m by -Xmx1024m or whatever size should be appropriate
2) your application is doing it
-right click on a source file
-Run as
-Run configurations...
-Arguments
-in vm arguments, just put -Xmx1024m or whatever size should be appropriate
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-0-1-in-eclip...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 9 months