Re: [rules-users] Assistance with DSL syntax

2007-09-12 Thread Christopher . Mathrusse

I was just looking for a more "short
hand" syntax, one where I would not need to declare "theOrder".

On the same subject though, I compiled
my rules with the DRL/DSL editors in Eclipse (very nice by the way) and
I am getting a compilation error being caused by my DSL entry:

[consequence][]Manually release the
Order=setManualRelease(drools.getRule().getName());retract(theOrder);



It seems that there is an issue with
the retract(theOrder);statement.

The method retract(Order)
is undefined for the type Rule_Maximum_Order_Amount_Exceeded_0    
   

Might you have any idea as to why this
would be occurring or exactly what the message is meaning?

Thanks for the help...







"Edson Tirelli"
<[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
09/12/2007 05:55 PM



Please respond to
Rules Users List 





To
"Rules Users List"



cc



Subject
Re: [rules-users] Assistance
with DSL syntax









   Yes, that is correct. 
   Why do you mean by a "cleaner" way?

    []s
    Edson

2007/9/12, [EMAIL PROTECTED]
<[EMAIL PROTECTED]>:

I'm using a DSL with my DRL file and I've read through the documentation
but I've gotten hung-up on the syntax. Below is a rule from my DRL and
the expansion in my DSL. 

My rule in the DRL: 
rule "Maximum
Order Amount Exceeded" 
salience 9800

        when

                   There is
an Order with

                   - an amount
that exceeds 10         
        then

                Manually release
the Order 
                
end 


My DSL: 
[condition][]There is an Order with=Order() 
[condition][]- an amount that exceeds {number}=amount >= {number}

[consequence][]Manually release the Order=setManualRelease(drools.getRule().getName());


What I would like to do is add to my consequence the following in red:

[consequence][]Manually release the Order=setManualRelease(drools.getRule().getName());retract(theOrder);



I know that I would need to modify my condition statement to be able to
use the variable theOrder  in my call to retract:

[condition][]There is an Order with=theOrder
: Order()



but is there a cleaner way to achieve this? 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646 
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Assistance with DSL syntax

2007-09-12 Thread Edson Tirelli
   Yes, that is correct.
   Why do you mean by a "cleaner" way?

[]s
Edson

2007/9/12, [EMAIL PROTECTED] <
[EMAIL PROTECTED]>:
>
>
> I'm using a DSL with my DRL file and I've read through the documentation
> but I've gotten hung-up on the syntax. Below is a rule from my DRL and the
> expansion in my DSL.
>
> My rule in the DRL:
> *rule* "Maximum Order Amount Exceeded"
> *salience* 9800
> *when*
>There *is* an Order *with*
>- an amount that exceeds 10
> *then*
> Manually release the Order
>
> *end*
>
>
> My DSL:
> [condition][]There is an Order with=Order()
> [condition][]- an amount that exceeds {number}=amount >= {number}
> [consequence][]Manually release the Order=setManualRelease(drools.getRule
> ().getName());
>
> What I would like to do is add to my consequence the following in red:
> [consequence][]Manually release the Order=setManualRelease(drools.getRule
> ().getName());*retract(theOrder);*
>
>
> I know that I would need to modify my condition statement to be able to
> use the variable *theOrder*  in my call to retract:
> [condition][]There is an Order with=*theOrder *: Order()
>
>
> but is there a cleaner way to achieve this?
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Assistance with DSL syntax

2007-09-12 Thread Christopher . Mathrusse

I'm using a DSL with my DRL file and
I've read through the documentation but I've gotten hung-up on the syntax.
Below is a rule from my DRL and the expansion in my DSL.

My rule in the DRL:
rule
"Maximum Order
Amount Exceeded"
salience
9800
        when
         
         There is
an Order with
         
         - an amount that exceeds 10
       
        then

         
      Manually release the Order
         
      
end


My DSL:
[condition][]There is an Order with=Order()
[condition][]- an amount that exceeds
{number}=amount >= {number}
[consequence][]Manually release the
Order=setManualRelease(drools.getRule().getName());

What I would like to do is add to my
consequence the following in red:
[consequence][]Manually release the
Order=setManualRelease(drools.getRule().getName());retract(theOrder);


I know that I would need to modify my
condition statement to be able to use the variable theOrder
 in my call to retract:
[condition][]There is an Order with=theOrder
: Order()


but is there a cleaner way to achieve
this?

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] RuleML-2007 CfPart - Early Bird Registration / Late-Breaking Demos

2007-09-12 Thread Adrian Paschke

 EARLY BIRD REGISTRATION DEADLINE

International RuleML Symposium on Rule Interchange and Applications
 (RuleML-2007)

  http://2007.ruleml.org/

We would like to kindly remind you about some important deadlines:

September 15, 2007: RuleML-2007 Early-Bird registration deadline.
September 14, 2007: Discounted Hotel booking deadline.

If you plan participate in RuleML-2007, but have not registered yet,
please, register now at: http://2007.ruleml.org/index-Dateien/Page930.htm

RuleML-2007 will be co-located with the Business Rules Forum and take
place in:

Buena Vista Palace
1900 Buena Vista Drive
Lake Buena Vista, FL 32830
Toll-Free: 1-866-397-6516
Tel:  (407) 827-2727Fax: (407) 827-6070
http://www.buenavistapalace.com/

A special rate is available while rooms are available in the Conference
room block, and only until September 14, 2007. You will get further
information on how to obtain the special rate during the RuleML-2007
registration. Please book early to avoid disappointment. To check hotel
availability you may go directly to the hotel Internet page.

You will find further accommodations, e.g. here:
http://www.orlando.com/
http://www.expedia.com/

Orlando Vista Hotel is in walking distance:
http://www.orlandovistahotel.com/
http://www.expedia.ca/pub/agent.dll/qscr=dspv/nojs=1/htid=2690

We would also like to recommend you to make FLIGHT booking as soon as
possible since rates will rise a lot as closer to the travel date.

The International RuleML Symposium on Rule Interchange and Applications
(RuleML-2007) will take place, October 25-26, 2007, in Orlando, Florida
, co-located with The 10th International
Business Rules Forum . RuleML-2007 is
devoted to practical distributed rule technologies and rule-based
applications which need language standards for rules operating in the
context of, e.g., the Semantic Web, Web 2.0, Intelligent Multi-Agent
Systems, Event-Driven Architectures, and Service-Oriented Computing
Applications.

The new RuleML-2007 Challenge provides an excellent opportunity to
demonstrate rule-based tools, use cases, and applications (and to win a
prestigious prize). Late-breaking demos for the RuleML-2007 Challenge
are welcome.
Please send title, author(s) and brief description by September, 30th to
[EMAIL PROTECTED]
.

We will appreciate if you would become a Sponsor:
http://2007.ruleml.org/index-Dateien/Page307.htm
Please have a look at the Levels and their Benefits:
http://2007.ruleml.org/sponsoring/SponsorshipPackage.pdf

Thank you,
RuleML-2007 Organizing Committee




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] java void in LHS

2007-09-12 Thread Tim . Nguyen
Hi all,

I would like to insert a java void to my condition(LHS). Is there anyway to
do that? Like an example below, how can I set something to my object before
evaluate it.


rule test123
when
 cheese: Chesse()

--->>> chess.getType().setPrice("cheap");

 eval (chesse.getType () == "myType")


then
   .
end



Thanks,

Tim

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use not operator in drool.

2007-09-12 Thread Edson Tirelli
   Remove your "eval" and use "or" instead of "||" for the OR CE.

   Although, I feel that this is not what you want... what you want is
simply:

when
Map( this['city'] not in ( "mumbai", "delhi" ) )
then
//...
end

[]s
Edson

2007/9/12, Gaurav2007 <[EMAIL PROTECTED]>:
>
>
> Hi ALL,
>
> I am using drool4.0.1 in my application i am able to use IN,OR,AND
> operator
> but i am facing problem in using not operator.
>
> my requirement of not operator is just like a not gate.
>
> the way i am using it is :
>
> eval(not((Map( this["city"] !="mumbai"))||(Map( this["city"] =="delhi"
>
>
> so can you please help me out to solve this problem:
> should i use not operator or some thing else in drool.
>
> Thanks,
>
>
> --
> View this message in context:
> http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240.html#a12638430
> Sent from the drools - user mailing list archive at Nabble.com.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Adding constraints to facts in DSL

2007-09-12 Thread Andy Mei
Ok, i took the liberty and created a ticket for this.

http://jira.jboss.com/jira/browse/JBRULES-1186


On 9/12/07, Edson Tirelli <[EMAIL PROTECTED]> wrote:
>
>
>All,
>
>This is a limitation of the current DSL engine implementation. The
> problem is not really the "or", but the "-" implementation. The LHS and RHS
> of a DSL rule are processed line by line, so, to allow the behavior you are
> requesting, we will need to implement some look ahead mechanism with smart
> interpolation that does not exist today.
>I'm not sure if someone already opened a ticket for that, but in case
> not, may I ask you please to open? We will look into supporting that in the
> future.
>
>[]s
>Edson
>
>
> 2007/9/12, Andy Mei <[EMAIL PROTECTED]>:
> >
> > I am having the same problem as Stephane does.
> >
> > It's pretty bad if I need to hard code the 'or' constraint within a
> > single DSL constraint.  I guess I could split a complex OR constraint to
> > multiple rules with the same consequences, it just an ugly hack.  Also, how
> > does this work if we need a Or constraint within another group constraint?
> >
> > I just don't understand why the following doesn't work.
> >
> > [condition][]There is a Cheese with=Cheese()
> > [condition][]- age is less than {low} =age < {low}
> > [condition][]Or=or
> > [condition][]- age is more than {high}=age > {high}
> >
> > On 9/11/07, [EMAIL PROTECTED] <
> > [EMAIL PROTECTED]> wrote:
> >
> > >  Hi Vincent,
> > >
> > > Thanks for your answer but I would really like to use my synthax.
> > >
> > > I need to write "or" between 2 constraints and not in a single complex
> > > constraint.
> > >
> > > If someone else could help me ...
> > >
> > > DELBART Vincent <[EMAIL PROTECTED]> a écrit :
> > >
> > >
> > > > Hello Stephane,
> > > >
> > > > I think it's difficult to do that. Could you try this :
> > > > There is a Cheese with
> > > >- age is less than 42 or age is more than 60
> > > >- type is 'stilton'
> > > > with in your DSL
> > > > [condition][]There is a Cheese with=Cheese()
> > > > [condition][]- age is less than {low} or age is more than {high}=age
> > >
> > > > < {low} || age > {high}
> > > > [condition][]- type is '{type}'=type == "{type}"
> > > >
> > > > I don't see other solution...
> > > >
> > > > vdelbart
> > > >
> > > >
> > > >
> > > > 
> > > >
> > > > De : [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] De la part de
> > > > [EMAIL PROTECTED]
> > > > Envoyé : mardi 11 septembre 2007 10:16
> > > > À : rules-users@lists.jboss.org
> > > > Objet : [rules-users] Adding constraints to facts in DSL
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > > I'm using JBossDrools in my company and I have some problems with
> > > DSL.
> > > >
> > > > Actually, I would like to write something like this :
> > > >
> > > > There is a Cheese with
> > > >( - age is less
> > > > than 42
> > > > or
> > > > -  age is more than 60 )
> > > >- type is
> > > > 'stilton'
> > > >
> > > > Unfortunately, It's the drools parser which manage "-" char.
> > > >
> > > > Also this previous synthax don't work in the LHS.
> > > >
> > > > Anyone could help me to do an equivalent condition in my DSL ? If
> > > > possible with "-" sugar char.
> > > >
> > > > Stephane.
> > > >
> > > > PS : Sorry, for my very bad english.
> > > >
> > > >
> > > > 
> > > > This message was sent using IMP, the Internet Messaging Program.
> > > >
> > > >
> > >
> > >
> > >
> > > 
> > > This message was sent using IMP, the Internet Messaging Program.
> > >
> > > ___
> > > rules-users mailing list
> > > rules-users@lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> > >
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] column in OR

2007-09-12 Thread Raffaele Viola
yes, but in a decision table

regards
Raffo

2007/9/12, Edson Tirelli <[EMAIL PROTECTED]>:
>
>What do you mean?
>
> rule XXX
> when
> A() or B()
> then
>// do something
> end
>
>?
>
>Edson
>
> 2007/9/12, Raffaele Viola < [EMAIL PROTECTED]>:
> >
> > Hi all,
> >
> > how can I put two columns in OR
> >
> > Thanks
> > Raffo
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Adding constraints to facts in DSL

2007-09-12 Thread Edson Tirelli
   All,

   This is a limitation of the current DSL engine implementation. The
problem is not really the "or", but the "-" implementation. The LHS and RHS
of a DSL rule are processed line by line, so, to allow the behavior you are
requesting, we will need to implement some look ahead mechanism with smart
interpolation that does not exist today.
   I'm not sure if someone already opened a ticket for that, but in case
not, may I ask you please to open? We will look into supporting that in the
future.

   []s
   Edson


2007/9/12, Andy Mei <[EMAIL PROTECTED]>:
>
> I am having the same problem as Stephane does.
>
> It's pretty bad if I need to hard code the 'or' constraint within a single
> DSL constraint.  I guess I could split a complex OR constraint to multiple
> rules with the same consequences, it just an ugly hack.  Also, how does this
> work if we need a Or constraint within another group constraint?
>
> I just don't understand why the following doesn't work.
>
> [condition][]There is a Cheese with=Cheese()
> [condition][]- age is less than {low} =age < {low}
> [condition][]Or=or
> [condition][]- age is more than {high}=age > {high}
>
> On 9/11/07, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]> wrote:
>
> > Hi Vincent,
> >
> > Thanks for your answer but I would really like to use my synthax.
> >
> > I need to write "or" between 2 constraints and not in a single complex
> > constraint.
> >
> > If someone else could help me ...
> >
> > DELBART Vincent <[EMAIL PROTECTED]> a écrit :
> >
> >
> > > Hello Stephane,
> > >
> > > I think it's difficult to do that. Could you try this :
> > > There is a Cheese with
> > >- age is less than 42 or age is more than 60
> > >- type is 'stilton'
> > > with in your DSL
> > > [condition][]There is a Cheese with=Cheese()
> > > [condition][]- age is less than {low} or age is more than {high}=age
> > > < {low} || age > {high}
> > > [condition][]- type is '{type}'=type == "{type}"
> > >
> > > I don't see other solution...
> > >
> > > vdelbart
> > >
> > >
> > >
> > > 
> > >
> > > De : [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] De la part de
> > > [EMAIL PROTECTED]
> > > Envoyé : mardi 11 septembre 2007 10:16
> > > À : rules-users@lists.jboss.org
> > > Objet : [rules-users] Adding constraints to facts in DSL
> > >
> > >
> > >
> > > Hello,
> > >
> > > I'm using JBossDrools in my company and I have some problems with DSL.
> > >
> > > Actually, I would like to write something like this :
> > >
> > > There is a Cheese with
> > >( - age is less
> > > than 42
> > > or
> > > -  age is more than 60 )
> > >- type is
> > > 'stilton'
> > >
> > > Unfortunately, It's the drools parser which manage "-" char.
> > >
> > > Also this previous synthax don't work in the LHS.
> > >
> > > Anyone could help me to do an equivalent condition in my DSL ? If
> > > possible with "-" sugar char.
> > >
> > > Stephane.
> > >
> > > PS : Sorry, for my very bad english.
> > >
> > >
> > > 
> > > This message was sent using IMP, the Internet Messaging Program.
> > >
> > >
> >
> >
> >
> > 
> > This message was sent using IMP, the Internet Messaging Program.
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] column in OR

2007-09-12 Thread Edson Tirelli
   What do you mean?

rule XXX
when
A() or B()
then
   // do something
end

   ?

   Edson

2007/9/12, Raffaele Viola <[EMAIL PROTECTED]>:
>
> Hi all,
>
> how can I put two columns in OR
>
> Thanks
> Raffo
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to use not operator in drool.

2007-09-12 Thread Tim . Nguyen
I thought when you use eval, it is Java, not mvel. So i think this should
work:   eval (! (Map (.


Tim



   
 Gaurav2007
 <[EMAIL PROTECTED] 
 apgemini.com>  To 
 Sent by:  rules-users@lists.jboss.org 
 rules-users-bounc  cc 
 [EMAIL PROTECTED] 
 g Subject 
   [rules-users] How to use not
   operator in drool.  
 09/12/2007 08:49  
 AM
   
   
 Please respond to 
 Rules Users List  
 <[EMAIL PROTECTED] 
   s.jboss.org>
   
   





Hi ALL,

I am using drool4.0.1 in my application i am able to use IN,OR,AND operator
but i am facing problem in using not operator.

my requirement of not operator is just like a not gate.

the way i am using it is :

eval(not((Map( this["city"] !="mumbai"))||(Map( this["city"] =="delhi"


so can you please help me out to solve this problem:
should i use not operator or some thing else in drool.

Thanks,


--
View this message in context:
http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240.html#a12638430

Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to use not operator in drool.

2007-09-12 Thread Gaurav2007

Hi ALL,

I am using drool4.0.1 in my application i am able to use IN,OR,AND operator
but i am facing problem in using not operator.

my requirement of not operator is just like a not gate.

the way i am using it is :

eval(not((Map( this["city"] !="mumbai"))||(Map( this["city"] =="delhi"


so can you please help me out to solve this problem:
should i use not operator or some thing else in drool.

Thanks,


-- 
View this message in context: 
http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240.html#a12638430
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Adding constraints to facts in DSL

2007-09-12 Thread Andy Mei
I am having the same problem as Stephane does.

It's pretty bad if I need to hard code the 'or' constraint within a single
DSL constraint.  I guess I could split a complex OR constraint to multiple
rules with the same consequences, it just an ugly hack.  Also, how does this
work if we need a Or constraint within another group constraint?

I just don't understand why the following doesn't work.

[condition][]There is a Cheese with=Cheese()
[condition][]- age is less than {low} =age < {low}
[condition][]Or=or
[condition][]- age is more than {high}=age > {high}

On 9/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
> Hi Vincent,
>
> Thanks for your answer but I would really like to use my synthax.
>
> I need to write "or" between 2 constraints and not in a single complex
> constraint.
>
> If someone else could help me ...
>
> DELBART Vincent <[EMAIL PROTECTED]> a écrit :
>
>
> > Hello Stephane,
> >
> > I think it's difficult to do that. Could you try this :
> > There is a Cheese with
> >- age is less than 42 or age is more than 60
> >- type is 'stilton'
> > with in your DSL
> > [condition][]There is a Cheese with=Cheese()
> > [condition][]- age is less than {low} or age is more than {high}=age
> > < {low} || age > {high}
> > [condition][]- type is '{type}'=type == "{type}"
> >
> > I don't see other solution...
> >
> > vdelbart
> >
> >
> >
> > 
> >
> > De : [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] De la part de
> > [EMAIL PROTECTED]
> > Envoyé : mardi 11 septembre 2007 10:16
> > À : rules-users@lists.jboss.org
> > Objet : [rules-users] Adding constraints to facts in DSL
> >
> >
> >
> > Hello,
> >
> > I'm using JBossDrools in my company and I have some problems with DSL.
> >
> > Actually, I would like to write something like this :
> >
> > There is a Cheese with
> >( - age is less
> > than 42
> > or
> > -  age is more than 60 )
> >- type is
> > 'stilton'
> >
> > Unfortunately, It's the drools parser which manage "-" char.
> >
> > Also this previous synthax don't work in the LHS.
> >
> > Anyone could help me to do an equivalent condition in my DSL ? If
> > possible with "-" sugar char.
> >
> > Stephane.
> >
> > PS : Sorry, for my very bad english.
> >
> >
> > 
> > This message was sent using IMP, the Internet Messaging Program.
> >
> >
>
>
>
> 
> This message was sent using IMP, the Internet Messaging Program.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] column in OR

2007-09-12 Thread Raffaele Viola
Hi all,

how can I put two columns in OR

Thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Tuples discrimination

2007-09-12 Thread Edson Tirelli
   Eymeric,

   This is a fairly common case of finding the "best" of multiple choices
(usually, the max, min, etc). You can find some examples and explanation in
the wiki:

http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesFindMax

So, the answer to your question is: it must be done in the LHS.
AgendaFilters, IMO, should be used only for debug purposes, since they are
beyond the control of the rule writers.

BTW, the wiki was written when we had only Drools 3.0, so there is no
example of 4.0 features like accumulate, DSL, etc, so, feel free to improve
the docs with your findings and examples... :)

Thanks,
Edson



2007/9/12, Eymeric VIEUILLE <[EMAIL PROTECTED]>:
>
> Hi !
>
> After solving the problem of Out of Memory, I come back with another
> question :
>
> I currently implemented rules that give me tuples like this (in the
> agenda, before firing rules) : M1xM2xM3xM4.
>
>
> But now, I want to select THE tuple that as M1xM2xM3xM4 with a property
> p as little as possible to execute the right hand of the rule.
>
> For sample, I have the two following tuples activated in the agenda :
>
> M'1(date = "09/25/2006")  M'1(date = "09/25/2006")
> M'2(date = "09/26/2006")  M'2(date = "09/26/2006")
> M'3(date = "09/29/2006")  M"3(date = "09/27/2006")
> M'4(date = "09/31/2006")  M"4(date = "09/30/2006")
>
> I would like the second tuples to be selected for executing the right
> hand of the rule because dates of M'2, M"3, M"4 are the closest dates
> compared to M'1.
>
> The problem is that I do not know on what layer this selection must be
> made : in the Left Hand of the rule ? Or in a AgendaFilter (selecting
> the better tuple to use) ?
>
> For the LH, I thought to the "accumate" CE, but I am affraid to have
> unreadle rules (impossible to maintain). And I don't see quite well how
> to implement this with "accumulate" CE (knowing that I use a DSL).
>
> For the AgendaFilter, I saw that only the current activation is
> accessible...so impossible to compare whith other tuples
> valuesMoreover, I am affraid to make performance fall.
>
> Is this selection possible ? And what would be the best practice to
> implement it ?
>
> Regards,
> Eymeric.
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] rules name

2007-09-12 Thread Raffaele Viola
Hi all,

can I set using the decision table the name of each rules?

thanks
Raffo
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Tuples discrimination

2007-09-12 Thread Eymeric VIEUILLE

Hi !

After solving the problem of Out of Memory, I come back with another 
question :


I currently implemented rules that give me tuples like this (in the 
agenda, before firing rules) : M1xM2xM3xM4.



But now, I want to select THE tuple that as M1xM2xM3xM4 with a property 
p as little as possible to execute the right hand of the rule.


For sample, I have the two following tuples activated in the agenda :

M'1(date = "09/25/2006")  M'1(date = "09/25/2006")
M'2(date = "09/26/2006")  M'2(date = "09/26/2006")
M'3(date = "09/29/2006")  M"3(date = "09/27/2006")
M'4(date = "09/31/2006")  M"4(date = "09/30/2006")

I would like the second tuples to be selected for executing the right 
hand of the rule because dates of M'2, M"3, M"4 are the closest dates 
compared to M'1.


The problem is that I do not know on what layer this selection must be 
made : in the Left Hand of the rule ? Or in a AgendaFilter (selecting 
the better tuple to use) ?


For the LH, I thought to the "accumate" CE, but I am affraid to have 
unreadle rules (impossible to maintain). And I don't see quite well how 
to implement this with "accumulate" CE (knowing that I use a DSL).


For the AgendaFilter, I saw that only the current activation is 
accessible...so impossible to compare whith other tuples 
valuesMoreover, I am affraid to make performance fall.


Is this selection possible ? And what would be the best practice to 
implement it ?


Regards,
Eymeric.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Multivariable and multislots

2007-09-12 Thread Lars Braubach
Hi,

I was wondering how I can express pattern matchings in drools
that operate on sets of values (multivalues). As an example I
composed a Jess/Clips rule that is able to match every block
that has a green as well as a red block on top of it.

(deftemplate Block
  (slot name(type STRING)) 
  (slot color(type STRING))
  (multislot on (type symbol))
)

(defrule multimatch
  ?b1 <- (Block (on $?a1 ?x $?c1) (color "red"))
  ?b2 <- (Block (on $?a2 ?x $?c2) (color "green"))
 =>(printout t "match multimatch:" ?x ?b1 ?b2))

This rules triggers for every value of the multislot "on" which
is contained in both multifields. I tried playing around with
"memberof" and "contains" in drools but found no possibility
to operate on two sets. Is it possible?

Kind regards,
Lars
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users