Re: [rules-users] About String..."==" same as ".equals"?
by Joel G. Rivera-González
i see...
when 3.2 will be available?
:-)
ok...
so i'm writing the rules the wrong way?
i need to put the and's on the same line separated by ','?
i if wanted to the it the way i wrote the rules i would have to put a different name to each of the objects right? (mto1:MegaTransferObject mto2:MegaTransferObject, ect)
this is a little complicated and i dindt saw it on the documentation...where i can read about it?
i will rewrite the rules to match the right way...
thanks...
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Edson Tirelli <tirelli(a)post.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Tuesday, January 9, 2007 6:44:22 PM
Subject: Re: [rules-users] About String..."==" same as ".equals"?
Joel,
If it is the same object that you are trying to match against all of
those constraints, just list all your constraints separated by ',' (comma):
rule "dtv_discount_request"
when
mto : MegaTransferObject( orders_FkOrderTypeId ==
Constants.NEW_COMPLETED_ORDER_TYPE,
ct:other_ChannelType -> ( !
ct.equalsIgnoreCase(Constants.CHANNEL_TYPE_RESELLER)),
orders_FkChannelId !=
Constants.ISP_CHANNEL_ID_PRW,
orders_FkChannelId !=
Constants.ISP_CHANNEL_ID_TLD,
orders_FkChannelId !=
Constants.ISP_CHANNEL_ID_AOL,
other_HasDtvDiscountRequest == false,
pl:phoneList_GovernmentAccount -> ( (pl
== null) || ( pl.equals(Constants.FLAG_NO)) ),
cp:customerProfile_DtvDiscount -> ( (cp
== null) || ( cp.equals(Constants.FLAG_NO)) ),
oa:other_AccountType -> ( ( oa == null)
|| ( oa.equals( Constants.PHONE_TYPE_RESIDENTIAL)) ) )
then
menu.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
end
Just remember:
* you must have one and only one pattern for each single object you want
to match in each rule, i.e., the mapping between patterns and object
instances is always one-to-one.
* constraints are separated by ',' (comma), and ',' has an implicit
meaning of AND between constraints
* version 3.0.x does not support OR between constraints, so the way
around it is to use predicates like I demonstrated above. Version 3.2
already has support for connective OR constraints.
I hope it helps.
[]s
Edson
Joel G. Rivera-González wrote:
> i see...that would works...but now if you add stuff and make a rule
> that look like this, the binding will not work...
>
> rule "dtv_discount_request"
> when
> MegaTransferObject(orders_FkOrderTypeId ==
> Constants.NEW_COMPLETED_ORDER_TYPE) and
> not MegaTransferObject(ct:other_ChannelType ->
> (ct.equalsIgnoreCase(Constants.CHANNEL_TYPE_RESELLER))) and
> (not MegaTransferObject(orders_FkChannelId ==
> Constants.ISP_CHANNEL_ID_PRW) and
> not MegaTransferObject(orders_FkChannelId ==
> Constants.ISP_CHANNEL_ID_TLD) and
> not MegaTransferObject(orders_FkChannelId ==
> Constants.ISP_CHANNEL_ID_AOL)) and
> (MegaTransferObject(phoneList_GovernmentAccount == null) or
> MegaTransferObject(phoneList_GovernmentAccount == Constants.FLAG_NO)) and
> (MegaTransferObject(customerProfile_DtvDiscount == null) or
> MegaTransferObject(customerProfile_DtvDiscount == Constants.FLAG_NO)) and
> (MegaTransferObject(other_AccountType == null) or
> MegaTransferObject(other_AccountType ==
> Constants.PHONE_TYPE_RESIDENTIAL)) and
> MegaTransferObject(other_HasDtvDiscountRequest == false)
> then
> menu.add(new
> String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> end
>
> i was trying to bre creative and add megaTO: before all the
> MegaTransferObject and it gave me the compilation error you
> mention...but only after the third megaTO:
>
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
>
> ----- Original Message ----
> From: Edson Tirelli <tirelli(a)post.com>
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Sent: Tuesday, January 9, 2007 4:39:57 PM
> Subject: Re: [rules-users] About String..."==" same as ".equals"?
>
> Joel,
>
> I just noticed in your last rule you do the binding to the same
> variable:
>
> > megaTO:MegaTransferObject(other_AccountType == "RMS")
> > megaTO:MegaTransferObject(other_HasDtvDiscountRequest == false)
>
> I thought that feature was already disabled... :( it should give you
> an error of duplicate variable declaration! is it not raising an error
> when compiling the rule??
>
> The correct way of doing it if it is the same object is getting both
> constraints in the same pattern:
>
> megaTO: MegaTransferObject( other_AccountType == "RMS",
> other_HasDtvDiscountRequest == false)
>
> So, rules 1 and 2 are correct in not firing, since you would need 2
> different objects to match the 2 patterns in them.
> The mapping between patterns and objects is "one-to-one".
>
> []s
> Edson
>
>
>
> Joel G. Rivera-González wrote:
>
> > 1. i downloaded the latest release from the download page...
> > 2. just one MTO...the returning arrayList should have arround 10 values.
> >
> > will do an example and (class and ruleFile) and send it to your email...
> >
> > thanks
> >
> > Joel G. Rivera-Gonzalez
> > PRT
> >
> > "The first 90% of a project takes 90% of the time, the last 10% takes
> > the other 90% of the time" - Murphy's Law
> >
> >
> > ----- Original Message ----
> > From: Edson Tirelli <tirelli(a)post.com>
> > To: Rules Users List <rules-users(a)lists.jboss.org>
> > Sent: Tuesday, January 9, 2007 3:29:26 PM
> > Subject: Re: [rules-users] About String..."==" same as ".equals"?
> >
> >
> > Joel,
> >
> > Your rules seems to be correct.
> > Questions:
> >
> > 1. What JBRules version are you using?
> >
> > 2. How many MTO instances are you asserting in the working memory, that
> > would match each Pattern in your rule?
> >
> > It may be an issue with "or". Can you provide a self contained test
> > for me to investigate?
> >
> > Thank you
> > Edson
> >
> > Joel G. Rivera-González wrote:
> >
> > > i have to be doing something wrong...but it make no sense...
> > > a MegaTransferObject is asserted.
> > >
> > > case1: No rules fired.
> > > rule "dtv_discount_request"
> > > when
> > > MegaTransferObject(other_AccountType == null) or
> > > MegaTransferObject(other_AccountType ==
> > > Constants.PHONE_TYPE_RESIDENTIAL)
> > > MegaTransferObject(other_HasDtvDiscountRequest == false)
> > > then
> > > menu.add(new
> > > String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> > > Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> > > end
> > >
> > > case 2: no rule fired.
> > >
> > > rule "dtv_discount_request"
> > > when
> > > MegaTransferObject(other_AccountType == null) or
> > > MegaTransferObject(other_AccountType == "RMS")
> > > MegaTransferObject(other_HasDtvDiscountRequest == false)
> > > then
> > > menu.add(new
> > > String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> > > Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> > > end
> > >
> > > case 3: rule fired
> > >
> > > rule "dtv_discount_request"
> > > when
> > > megaTO:MegaTransferObject(other_AccountType == "RMS")
> > > megaTO:MegaTransferObject(other_HasDtvDiscountRequest ==
> false)
> > > then
> > > menu.add(new
> > > String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> > > Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> > > end
> > >
> > > i really dont get it...
> > > i must not be getting something...
> > > help...
> > >
> > >
> > > Joel G. Rivera-Gonzalez
> > > PRT
> > >
> > > "The first 90% of a project takes 90% of the time, the last 10% takes
> > > the other 90% of the time" - Murphy's Law
> > >
> > >
> > > ----- Original Message ----
> > > From: Edson Tirelli <tirelli(a)post.com>
> > > To: Rules Users List <rules-users(a)lists.jboss.org>
> > > Sent: Tuesday, January 9, 2007 7:26:35 AM
> > > Subject: Re: [rules-users] About String..."==" same as ".equals"?
> > >
> > >
> > > Joel,
> > >
> > > This is the correct syntax and it works (at least we didn't get a
> > > report for it not working yet):
> > >
> > > Object(variable == Constants.value)
> > >
> > > Can you please elaborate about the problem you are having in order
> > > for us to help solving it? If it is a bug we need to fix.
> > >
> > > Thank you,
> > > Edson
> > >
> > > Joel G. Rivera-González wrote:
> > >
> > > > most (if not all) of my rules will have conditions like this:
> > > > Object(variable == Constants.value)
> > > > this is not working...
> > > > BUT if i change the Constants.value to corresponding value from the
> > > > constants class it will work...
> > > > is there any other way other than this Object(a:variable->
> > > > (a.equals(Constants.value)) to do it?
> > > >
> > > >
> > > >
> > > >
> > > > Joel G. Rivera-Gonzalez
> > > > PRT
> > > >
> > > > "The first 90% of a project takes 90% of the time, the last 10%
> takes
> > > > the other 90% of the time" - Murphy's Law
> > > >
> > >
> >
> >------------------------------------------------------------------------
> > > >
> > > >_______________________________________________
> > > >rules-users mailing list
> > > >rules-users(a)lists.jboss.org
> > > >https://lists.jboss.org/mailman/listinfo/rules-users
> > > >
> > > >
> > >
> > >
> > > --
> > > Edson Tirelli
> > > Software Engineer - JBoss Rules Core Developer
> > > Office: +55 11 3124-6000
> > > Mobile: +55 11 9218-4151
> > > JBoss, a division of Red Hat @ www.jboss.com
> <http://www.jboss.com> <http://www.jboss.com>
> > <http://www.jboss.com>
> > >
> > >
> > > _______________________________________________
> > > rules-users mailing list
> > > rules-users(a)lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> >
> >------------------------------------------------------------------------
> > >
> > >_______________________________________________
> > >rules-users mailing list
> > >rules-users(a)lists.jboss.org
> > >https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> > >
> >
> >
> > --
> > Edson Tirelli
> > Software Engineer - JBoss Rules Core Developer
> > Office: +55 11 3124-6000
> > Mobile: +55 11 9218-4151
> > JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
> <http://www.jboss.com>
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >rules-users mailing list
> >rules-users(a)lists.jboss.org
> >https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3124-6000
> Mobile: +55 11 9218-4151
> JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>------------------------------------------------------------------------
>
>_______________________________________________
>rules-users mailing list
>rules-users(a)lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
Re: [rules-users] About String..."==" same as ".equals"?
by Joel G. Rivera-González
i see...that would works...but now if you add stuff and make a rule that look like this, the binding will not work...
rule "dtv_discount_request"
when
MegaTransferObject(orders_FkOrderTypeId == Constants.NEW_COMPLETED_ORDER_TYPE) and
not MegaTransferObject(ct:other_ChannelType -> (ct.equalsIgnoreCase(Constants.CHANNEL_TYPE_RESELLER))) and
(not MegaTransferObject(orders_FkChannelId == Constants.ISP_CHANNEL_ID_PRW) and
not MegaTransferObject(orders_FkChannelId == Constants.ISP_CHANNEL_ID_TLD) and
not MegaTransferObject(orders_FkChannelId == Constants.ISP_CHANNEL_ID_AOL)) and
(MegaTransferObject(phoneList_GovernmentAccount == null) or MegaTransferObject(phoneList_GovernmentAccount == Constants.FLAG_NO)) and
(MegaTransferObject(customerProfile_DtvDiscount == null) or MegaTransferObject(customerProfile_DtvDiscount == Constants.FLAG_NO)) and
(MegaTransferObject(other_AccountType == null) or MegaTransferObject(other_AccountType == Constants.PHONE_TYPE_RESIDENTIAL)) and
MegaTransferObject(other_HasDtvDiscountRequest == false)
then
menu.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL, Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
end
i was trying to bre creative and add megaTO: before all the MegaTransferObject and it gave me the compilation error you mention...but only after the third megaTO:
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Edson Tirelli <tirelli(a)post.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Tuesday, January 9, 2007 4:39:57 PM
Subject: Re: [rules-users] About String..."==" same as ".equals"?
Joel,
I just noticed in your last rule you do the binding to the same variable:
> megaTO:MegaTransferObject(other_AccountType == "RMS")
> megaTO:MegaTransferObject(other_HasDtvDiscountRequest == false)
I thought that feature was already disabled... :( it should give you
an error of duplicate variable declaration! is it not raising an error
when compiling the rule??
The correct way of doing it if it is the same object is getting both
constraints in the same pattern:
megaTO: MegaTransferObject( other_AccountType == "RMS",
other_HasDtvDiscountRequest == false)
So, rules 1 and 2 are correct in not firing, since you would need 2
different objects to match the 2 patterns in them.
The mapping between patterns and objects is "one-to-one".
[]s
Edson
Joel G. Rivera-González wrote:
> 1. i downloaded the latest release from the download page...
> 2. just one MTO...the returning arrayList should have arround 10 values.
>
> will do an example and (class and ruleFile) and send it to your email...
>
> thanks
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
>
> ----- Original Message ----
> From: Edson Tirelli <tirelli(a)post.com>
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Sent: Tuesday, January 9, 2007 3:29:26 PM
> Subject: Re: [rules-users] About String..."==" same as ".equals"?
>
>
> Joel,
>
> Your rules seems to be correct.
> Questions:
>
> 1. What JBRules version are you using?
>
> 2. How many MTO instances are you asserting in the working memory, that
> would match each Pattern in your rule?
>
> It may be an issue with "or". Can you provide a self contained test
> for me to investigate?
>
> Thank you
> Edson
>
> Joel G. Rivera-González wrote:
>
> > i have to be doing something wrong...but it make no sense...
> > a MegaTransferObject is asserted.
> >
> > case1: No rules fired.
> > rule "dtv_discount_request"
> > when
> > MegaTransferObject(other_AccountType == null) or
> > MegaTransferObject(other_AccountType ==
> > Constants.PHONE_TYPE_RESIDENTIAL)
> > MegaTransferObject(other_HasDtvDiscountRequest == false)
> > then
> > menu.add(new
> > String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> > Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> > end
> >
> > case 2: no rule fired.
> >
> > rule "dtv_discount_request"
> > when
> > MegaTransferObject(other_AccountType == null) or
> > MegaTransferObject(other_AccountType == "RMS")
> > MegaTransferObject(other_HasDtvDiscountRequest == false)
> > then
> > menu.add(new
> > String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> > Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> > end
> >
> > case 3: rule fired
> >
> > rule "dtv_discount_request"
> > when
> > megaTO:MegaTransferObject(other_AccountType == "RMS")
> > megaTO:MegaTransferObject(other_HasDtvDiscountRequest == false)
> > then
> > menu.add(new
> > String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> > Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> > end
> >
> > i really dont get it...
> > i must not be getting something...
> > help...
> >
> >
> > Joel G. Rivera-Gonzalez
> > PRT
> >
> > "The first 90% of a project takes 90% of the time, the last 10% takes
> > the other 90% of the time" - Murphy's Law
> >
> >
> > ----- Original Message ----
> > From: Edson Tirelli <tirelli(a)post.com>
> > To: Rules Users List <rules-users(a)lists.jboss.org>
> > Sent: Tuesday, January 9, 2007 7:26:35 AM
> > Subject: Re: [rules-users] About String..."==" same as ".equals"?
> >
> >
> > Joel,
> >
> > This is the correct syntax and it works (at least we didn't get a
> > report for it not working yet):
> >
> > Object(variable == Constants.value)
> >
> > Can you please elaborate about the problem you are having in order
> > for us to help solving it? If it is a bug we need to fix.
> >
> > Thank you,
> > Edson
> >
> > Joel G. Rivera-González wrote:
> >
> > > most (if not all) of my rules will have conditions like this:
> > > Object(variable == Constants.value)
> > > this is not working...
> > > BUT if i change the Constants.value to corresponding value from the
> > > constants class it will work...
> > > is there any other way other than this Object(a:variable->
> > > (a.equals(Constants.value)) to do it?
> > >
> > >
> > >
> > >
> > > Joel G. Rivera-Gonzalez
> > > PRT
> > >
> > > "The first 90% of a project takes 90% of the time, the last 10% takes
> > > the other 90% of the time" - Murphy's Law
> > >
> >
> >------------------------------------------------------------------------
> > >
> > >_______________________________________________
> > >rules-users mailing list
> > >rules-users(a)lists.jboss.org
> > >https://lists.jboss.org/mailman/listinfo/rules-users
> > >
> > >
> >
> >
> > --
> > Edson Tirelli
> > Software Engineer - JBoss Rules Core Developer
> > Office: +55 11 3124-6000
> > Mobile: +55 11 9218-4151
> > JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
> <http://www.jboss.com>
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >rules-users mailing list
> >rules-users(a)lists.jboss.org
> >https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3124-6000
> Mobile: +55 11 9218-4151
> JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>------------------------------------------------------------------------
>
>_______________________________________________
>rules-users mailing list
>rules-users(a)lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
Re: [rules-users] About String..."==" same as ".equals"?
by Joel G. Rivera-González
1. i downloaded the latest release from the download page...
2. just one MTO...the returning arrayList should have arround 10 values.
will do an example and (class and ruleFile) and send it to your email...
thanks
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Edson Tirelli <tirelli(a)post.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Tuesday, January 9, 2007 3:29:26 PM
Subject: Re: [rules-users] About String..."==" same as ".equals"?
Joel,
Your rules seems to be correct.
Questions:
1. What JBRules version are you using?
2. How many MTO instances are you asserting in the working memory, that
would match each Pattern in your rule?
It may be an issue with "or". Can you provide a self contained test
for me to investigate?
Thank you
Edson
Joel G. Rivera-González wrote:
> i have to be doing something wrong...but it make no sense...
> a MegaTransferObject is asserted.
>
> case1: No rules fired.
> rule "dtv_discount_request"
> when
> MegaTransferObject(other_AccountType == null) or
> MegaTransferObject(other_AccountType ==
> Constants.PHONE_TYPE_RESIDENTIAL)
> MegaTransferObject(other_HasDtvDiscountRequest == false)
> then
> menu.add(new
> String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> end
>
> case 2: no rule fired.
>
> rule "dtv_discount_request"
> when
> MegaTransferObject(other_AccountType == null) or
> MegaTransferObject(other_AccountType == "RMS")
> MegaTransferObject(other_HasDtvDiscountRequest == false)
> then
> menu.add(new
> String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> end
>
> case 3: rule fired
>
> rule "dtv_discount_request"
> when
> megaTO:MegaTransferObject(other_AccountType == "RMS")
> megaTO:MegaTransferObject(other_HasDtvDiscountRequest == false)
> then
> menu.add(new
> String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
> Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
> end
>
> i really dont get it...
> i must not be getting something...
> help...
>
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
>
> ----- Original Message ----
> From: Edson Tirelli <tirelli(a)post.com>
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Sent: Tuesday, January 9, 2007 7:26:35 AM
> Subject: Re: [rules-users] About String..."==" same as ".equals"?
>
>
> Joel,
>
> This is the correct syntax and it works (at least we didn't get a
> report for it not working yet):
>
> Object(variable == Constants.value)
>
> Can you please elaborate about the problem you are having in order
> for us to help solving it? If it is a bug we need to fix.
>
> Thank you,
> Edson
>
> Joel G. Rivera-González wrote:
>
> > most (if not all) of my rules will have conditions like this:
> > Object(variable == Constants.value)
> > this is not working...
> > BUT if i change the Constants.value to corresponding value from the
> > constants class it will work...
> > is there any other way other than this Object(a:variable->
> > (a.equals(Constants.value)) to do it?
> >
> >
> >
> >
> > Joel G. Rivera-Gonzalez
> > PRT
> >
> > "The first 90% of a project takes 90% of the time, the last 10% takes
> > the other 90% of the time" - Murphy's Law
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >rules-users mailing list
> >rules-users(a)lists.jboss.org
> >https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3124-6000
> Mobile: +55 11 9218-4151
> JBoss, a division of Red Hat @ www.jboss.com <http://www.jboss.com>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>------------------------------------------------------------------------
>
>_______________________________________________
>rules-users mailing list
>rules-users(a)lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
Re: [rules-users] About String..."==" same as ".equals"?
by Joel G. Rivera-González
i have to be doing something wrong...but it make no sense...
a MegaTransferObject is asserted.
case1: No rules fired.
rule "dtv_discount_request"
when
MegaTransferObject(other_AccountType == null) or
MegaTransferObject(other_AccountType == Constants.PHONE_TYPE_RESIDENTIAL)
MegaTransferObject(other_HasDtvDiscountRequest == false)
then
menu.add(new String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL, Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
end
case 2: no rule fired.
rule "dtv_discount_request"
when
MegaTransferObject(other_AccountType == null) or
MegaTransferObject(other_AccountType == "RMS")
MegaTransferObject(other_HasDtvDiscountRequest == false)
then
menu.add(new
String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
end
case 3: rule fired
rule "dtv_discount_request"
when
megaTO:MegaTransferObject(other_AccountType == "RMS")
megaTO:MegaTransferObject(other_HasDtvDiscountRequest == false)
then
menu.add(new
String[]{Constants.SERVICE_ASSURANCE_TREE_MENU_DSL,
Constants.SERVICE_ASSURANCE_MENU_DTV_DISCOUNT_REQUEST});
end
i really dont get it...
i must not be getting something...
help...
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: Edson Tirelli <tirelli(a)post.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Tuesday, January 9, 2007 7:26:35 AM
Subject: Re: [rules-users] About String..."==" same as ".equals"?
Joel,
This is the correct syntax and it works (at least we didn't get a
report for it not working yet):
Object(variable == Constants.value)
Can you please elaborate about the problem you are having in order
for us to help solving it? If it is a bug we need to fix.
Thank you,
Edson
Joel G. Rivera-González wrote:
> most (if not all) of my rules will have conditions like this:
> Object(variable == Constants.value)
> this is not working...
> BUT if i change the Constants.value to corresponding value from the
> constants class it will work...
> is there any other way other than this Object(a:variable->
> (a.equals(Constants.value)) to do it?
>
>
>
>
> Joel G. Rivera-Gonzalez
> PRT
>
> "The first 90% of a project takes 90% of the time, the last 10% takes
> the other 90% of the time" - Murphy's Law
>
>------------------------------------------------------------------------
>
>_______________________________________________
>rules-users mailing list
>rules-users(a)lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
Re: [rules-users] is "==" case sensitive
by rules-users@lists.jboss.org
maybe in the next release something similar to ignorecase could be added as an operator...
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
To: rules-users(a)lists.jboss.org
Sent: Monday, January 8, 2007 1:24:17 PM
Subject: Re: [rules-users] is "==" case sensitive
if you can do it with a regex (which I am not sure if you can) then you can use the "matches" operator.
Otherwise you can do it with a predicate:
Something(a:field -> (a.equalsIgnoreCase("some string")) )
On 1/8/07, rules-users(a)lists.jboss.org <rules-users(a)lists.jboss.org
> wrote:
what i would do to make in not case sensitive (like string1.equalsIgnoreCase(string2))?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: "rules-users(a)lists.jboss.org" <
rules-users(a)lists.jboss.org>
To: rules-users(a)lists.jboss.org
Sent: Monday, January 8, 2007 10:49:08 AM
Subject: Re: [rules-users] is "==" case sensitive
For Strings I presume ? Yes it should be case sensitive.
On 1/8/07,
rules-users(a)lists.jboss.org <
rules-users(a)lists.jboss.org> wrote:
I dont find anything on the documentation...and i think it is important to know...
thanks !
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
About String..."==" same as ".equals"?
by Joel G. Rivera-González
most (if not all) of my rules will have conditions like this:
Object(variable == Constants.value)
this is not working...
BUT if i change the Constants.value to corresponding value from the constants class it will work...
is there any other way other than this Object(a:variable-> (a.equals(Constants.value)) to do it?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
17 years, 11 months
Re: Better way to use And and Or
by rules-users@lists.jboss.org
Not yet.
This feature is already implemented, but trunk is yet going under
refactory. So you may start to test/use it, but be aware that there may
be problems yet to solve.
[]s
Edson
PS: Please use the "users" list for this kind of questions. I'm already
replying to it.
rules-dev(a)lists.jboss.org wrote:
>which is the next version. Is it aalready out?
>
>
>drools - dev mailing list wrote:
>
>
>> Hi,
>>
>> In Drools 3.0, having the RCVRCOUNTRY and SNDRCOUNTRY as attributes
>>of the same bean, there is no better way of doing than:
>>
>>when
>>
>>m: ( (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "US", AMOUNT
>>
>>
>>"3000")) ||
>> (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "UK", AMOUNT >
>>"3000")) ||
>> (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "CAN", AMOUNT >
>>"3000")) ||
>> (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "US", AMOUNT >
>>"3000")) ||
>> (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "UK", AMOUNT >
>>"3000")) ||
>> (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "CAN", AMOUNT >
>>"3000")) )
>>
>>then
>>
>>end
>>
>> In next version you can do:
>>
>>when
>> m: TransactionBean( RCVRCOUNTRY == "IRAQ" |== "IRAN", SNDRCOUNTRY ==
>>"US" |== "CAN" |== "UK" )
>>then
>>end
>>
>> []s
>> Edson
>>
>>
>>
>>rules-dev(a)lists.jboss.org wrote:
>>
>>
>>
>>>Hi,
>>>I am using Drools 3.0
>>>For below rule
>>>
>>>RCVRCOUNTRY == IRAQ,IRAN
>>>SNDRCOUNTRY == US,CAN,UK
>>>AMOUNT > 3000
>>>i have to compile the drl with this
>>>
>>>m: (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "US", AMOUNT >
>>>"3000"))
>>>m: (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "UK", AMOUNT >
>>>"3000"))
>>>m: (TransactionBean(RCVRCOUNTRY == "IRAQ", SNDRCOUNTRY == "CAN", AMOUNT >
>>>"3000"))
>>>m: (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "US", AMOUNT >
>>>"3000"))
>>>m: (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "UK", AMOUNT >
>>>"3000"))
>>>m: (TransactionBean(RCVRCOUNTRY == "IRAN", SNDRCOUNTRY == "CAN", AMOUNT >
>>>"3000"))
>>>
>>>Is there any other easier / better way to express this as a valid DRL?
>>>
>>>
>using
>
>
>>>|
>>>
>>>
>>>
>>>
>>>
>>--
>> Edson Tirelli
>> Software Engineer - JBoss Rules Core Developer
>> Office: +55 11 3124-6000
>> Mobile: +55 11 9218-4151
>> JBoss, a division of Red Hat @ www.jboss.com
>>
>>
>>_______________________________________________
>>rules-dev mailing list
>>rules-dev(a)lists.jboss.org
>>https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>>
>>
>
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
17 years, 11 months
Re: [rules-users] is "==" case sensitive
by rules-users@lists.jboss.org
what i would do to make in not case sensitive (like string1.equalsIgnoreCase(string2))?
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
----- Original Message ----
From: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
To: rules-users(a)lists.jboss.org
Sent: Monday, January 8, 2007 10:49:08 AM
Subject: Re: [rules-users] is "==" case sensitive
For Strings I presume ? Yes it should be case sensitive.
On 1/8/07, rules-users(a)lists.jboss.org <
rules-users(a)lists.jboss.org> wrote:
I dont find anything on the documentation...and i think it is important to know...
thanks !
Joel G. Rivera-Gonzalez
PRT
"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 11 months
Re: [drools-user] Axis2 1.1 Breaks Drools(v. 3.0.5) Rule Compilation
by rules-users@lists.jboss.org
That definately looks like a classpath error, somehow the classpath has lost
scope to see your classes.
Also, we have migrated to the jboss mail servers now (see the other mailing
list).
On 1/7/07, Paul O'Connor <paulhoconnor(a)yahoo.com> wrote:
>
> I was successfully compiling and using rules in an
> Axis2 web service under Axis 2 v. 1.0. Version 1.1
> breaks my codebase. Now, my domain object types are
> not loaded, and a suspicious error message arises
> relating to a core Drools calss not loading:
>
> Rule Compilation error Class
> "org.drools.spi.KnowledgeHelper" not found
>
> I suspect a classloader change in Axis2, but was
> wondering if anyone can shed light on what is going on
> at this point in the package validation of rule
> compilatation before I chase the Axis2 change.
>
> The full error trace is below.
>
> Thanks in advance!
>
>
> org.drools.rule.InvalidRulePackage: Unable to resolve
> ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'Product'
> Unable to resolve ObjectType 'Account'
> Unable to resolve ObjectType 'RequestedBump'
> Unable to resolve ObjectType 'RequestedBump'
> Unable to resolve ObjectType 'RequestedBump'
> Rule Compilation error Class
> "org.drools.spi.KnowledgeHelper" not found Class "o
> rg.drools.spi.KnowledgeHelper" not found Unknown
> variable or type "result" Class
> "java.lang.Object" has no method named
> "setBasisPoints" Expression "result" is
> not an rvalue Expression "result" is not an rvalue
> Expression "result" is not an
> rvalue Unknown variable or type "result" Unknown
> variable or type "result" Clas
> s "java.lang.Object" has no method named "setReason"
> Expression "result" is not
> an rvalue Expression "result" is not an rvalue
> Expression "result" is not an rva
> lue Unknown variable or type "result" Exception:14
> errors while compiling unit "
> com/sovereignbank/sovplatform/rules/rates/Rule_Bump_Rate_22_0.java"
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
17 years, 11 months
Re: [drools-user] Auto Unsubscribe
by rules-users@lists.jboss.org
Rohit, you should be on this list (rules-users(a)lists.jboss.org) now
automatically. Old list on codehaus.org will be retired.
Michael.
On 1/8/07, Research <p.rohit(a)verchaska.com> wrote:
>
> hi...
> looks like i got unsubscribed from the mailing list, but i didnt
> send a request for the same. how did it happen? what shud i do?
>
> regards..
> Rohit Pillai.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
17 years, 11 months