[rules-users] matches operator

2007-07-09 Thread Ashwini Joshi
Hi,

 

 

Has anyone used the matches operator? 

In our application we need to support startWith, endsWith operators for
string variable. I am thinking of using matches operator. But the 'matches'
operator is not working. I am trying the following code

 

rule Hello World

  when

m : Message(message matches Hello*)

  then

System.out.println( Hello World); 

end

 

 

 

And the value set in the message is Hello World. But it is not going into
the then clause.

 

If anyone has already used matches operator I would like to know how we can
use it for startswith, endsWith. How do we specify the regular expression?
Can we use *

 

 

Thanks,

Ashwini


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Pvt. Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Pvt. Ltd. does not accept any liability for virus infected mails.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] toString

2007-07-09 Thread Mike D

As an example, in Shipment.Header we'd have a port.Lading with a numeric
value of 901 and in District.Port, it would be the character equivalent of
0901 zero filled.

thanks,
Mike
-- 
View this message in context: 
http://www.nabble.com/toString-tf4029720.html#a11498978
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] matches operator

2007-07-09 Thread Mark Proctor

Read up on regular expression, what you just wrote there is not valid.

Mark
Ashwini Joshi wrote:


Hi,

 

 


Has anyone used the matches operator?

In our application we need to support startWith, endsWith operators 
for string variable. I am thinking of using matches operator. But the 
'matches' operator is not working. I am trying the following code


 


*rule* Hello World

  *when*

m : Message(message matches Hello*)

  *then*

System.out.println( Hello World);

*end*

 

 

 

And the value set in the message is Hello World. But it is not going 
into the then clause.


 

If anyone has already used matches operator I would like to know how 
we can use it for startswith, endsWith. How do we specify the regular 
expression? Can we use *


 

 


Thanks,

Ashwini

DISCLAIMER == This e-mail may contain privileged and 
confidential information which is the property of Persistent Systems 
Pvt. Ltd. It is intended only for the use of the individual or entity 
to which it is addressed. If you are not the intended recipient, you 
are not authorized to read, retain, copy, print, distribute or use 
this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent 
Systems Pvt. Ltd. does not accept any liability for virus infected mails.




___
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] RE: rules-users Digest, Vol 8, Issue 45

2007-07-09 Thread Sikkandar Nawabjan

--

Message: 5
Date: Mon, 9 Jul 2007 13:05:25 +0530
From: Ashwini Joshi [EMAIL PROTECTED]
Subject: [rules-users] matches operator
To: rules-users@lists.jboss.org
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii

Hi,





Has anyone used the matches operator?

In our application we need to support startWith, endsWith operators for
string variable. I am thinking of using matches operator. But the 'matches'
operator is not working. I am trying the following code



rule Hello World

  when

m : Message(message matches Hello*)

  then

System.out.println( Hello World);

end







And the value set in the message is Hello World. But it is not going into
the then clause.



If anyone has already used matches operator I would like to know how we can
use it for startswith, endsWith. How do we specify the regular expression?
Can we use *





Thanks,

Ashwini


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Pvt. Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Pvt. Ltd. does not accept any liability for virus infected mails.
-- next part --
An HTML attachment was scrubbed...
URL: 
http://lists.jboss.org/pipermail/rules-users/attachments/20070709/d9bbcbc8/attachment.html

--

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


End of rules-users Digest, Vol 8, Issue 45
**


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


RE: [rules-users] matches operator

2007-07-09 Thread Hehl, Thomas
Also, Java is far stricter on syntax for regular expressions than anything
else I've seen. You can't just test your stuff at a unix prompt or using
grep to see if it works. That's just the first step. I generally use the vi
find command.

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Monday, July 09, 2007 7:16 AM
To: Rules Users List
Subject: Re: [rules-users] matches operator

 

Read up on regular expression, what you just wrote there is not valid.

Mark
Ashwini Joshi wrote: 

Hi,

 

 

Has anyone used the matches operator? 

In our application we need to support startWith, endsWith operators for
string variable. I am thinking of using matches operator. But the 'matches'
operator is not working. I am trying the following code

 

rule Hello World

  when

m : Message(message matches Hello*)

  then

System.out.println( Hello World); 

end

 

 

 

And the value set in the message is Hello World. But it is not going into
the then clause.

 

If anyone has already used matches operator I would like to know how we can
use it for startswith, endsWith. How do we specify the regular expression?
Can we use *

 

 

Thanks,

Ashwini

DISCLAIMER == This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Pvt. Ltd. It is
intended only for the use of the individual or entity to which it is
addressed. If you are not the intended recipient, you are not authorized to
read, retain, copy, print, distribute or use this message. If you have
received this communication in error, please notify the sender and delete
all copies of this message. Persistent Systems Pvt. Ltd. does not accept any
liability for virus infected mails.

 





  _  



 
___
rules-users mailing list
rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users
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] matches operator

2007-07-09 Thread Hehl, Thomas
Try ^Hello.* I think, I'm not very good with regular expressions.

 

For more information, have a look at:
http://www.regular-expressions.info/tutorial.html

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ashwini Joshi
Sent: Monday, July 09, 2007 8:54 AM
To: 'Rules Users List'
Subject: RE: [rules-users] matches operator

 

Can you please give me example of using matches operator for startswith?

 

 

Thanks,

Ashwini

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hehl, Thomas
Sent: Monday, July 09, 2007 5:31 PM
To: 'Rules Users List'
Subject: RE: [rules-users] matches operator

 

Also, Java is far stricter on syntax for regular expressions than anything
else I've seen. You can't just test your stuff at a unix prompt or using
grep to see if it works. That's just the first step. I generally use the vi
find command.

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Monday, July 09, 2007 7:16 AM
To: Rules Users List
Subject: Re: [rules-users] matches operator

 

Read up on regular expression, what you just wrote there is not valid.

Mark
Ashwini Joshi wrote: 

Hi,

 

 

Has anyone used the matches operator? 

In our application we need to support startWith, endsWith operators for
string variable. I am thinking of using matches operator. But the 'matches'
operator is not working. I am trying the following code

 

rule Hello World

  when

m : Message(message matches Hello*)

  then

System.out.println( Hello World); 

end

 

 

 

And the value set in the message is Hello World. But it is not going into
the then clause.

 

If anyone has already used matches operator I would like to know how we can
use it for startswith, endsWith. How do we specify the regular expression?
Can we use *

 

 

Thanks,

Ashwini

DISCLAIMER == This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Pvt. Ltd. It is
intended only for the use of the individual or entity to which it is
addressed. If you are not the intended recipient, you are not authorized to
read, retain, copy, print, distribute or use this message. If you have
received this communication in error, please notify the sender and delete
all copies of this message. Persistent Systems Pvt. Ltd. does not accept any
liability for virus infected mails.

 
 
 
 
 





  _  



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

 

DISCLAIMER == This e-mail may contain privileged and confidential
information which is the property of Persistent Systems Pvt. Ltd. It is
intended only for the use of the individual or entity to which it is
addressed. If you are not the intended recipient, you are not authorized to
read, retain, copy, print, distribute or use this message. If you have
received this communication in error, please notify the sender and delete
all copies of this message. Persistent Systems Pvt. Ltd. does not accept any
liability for virus infected mails.

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


[rules-users] JBoss Drools vs JBoss Rules

2007-07-09 Thread Mark Proctor

http://markproctor.blogspot.com/2007/07/jboss-drools-vs-jboss-rules.html
Feedback welcome please :)

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


[rules-users] 4.0 Language Updates

2007-07-09 Thread Ronald R. DiFrango

All,

I have the following rule:

rule Repayment Code Requires Approval
   salience 60

   when
   repaymentCode : RepaymentCode( code == MD, matchApprv == Y )
   mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, $amt2 :
sumCmAndRnr)
   eval($amt1.doubleValue() == $amt2.doubleValue())
   then
   System.out.println(Repayment Code Requires Approval);
   processMDAdjustments(drools.getWorkingMemory().getQueryResults( MD
Adjustments ), StatusConstants.APPROVAL);
   System.out.println(mdOutput:  + mdOutput);
end

If I remember correctly, there was going to be an update to the rules
language that would allow me to eliminate the eval.  Is this true and if so
what is the syntax that accomplishes this?

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


[rules-users] Re: 4.0 Language Updates

2007-07-09 Thread Ronald R. DiFrango

OK, I think I found it and here is what the rule could look like:

rule Repayment Code Requires Approval
   salience 60

   when
   repaymentCode : RepaymentCode( code == MD, matchApprv == Y )
   mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, sumCmAndRnr ==
$amt1)
   then
   System.out.println(Repayment Code Requires Approval);
   processMDAdjustments(drools.getWorkingMemory().getQueryResults( MD
Adjustments ), StatusConstants.APPROVAL);
   System.out.println(mdOutput:  + mdOutput);
end

Now my question is, how does Drools handle these objects and the comparison
because the underlying objects are BigDecimal?

On 7/9/07, Ronald R. DiFrango [EMAIL PROTECTED] wrote:


All,

I have the following rule:

rule Repayment Code Requires Approval
salience 60

when
repaymentCode : RepaymentCode( code == MD, matchApprv == Y )
mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, $amt2 :
sumCmAndRnr)
eval($amt1.doubleValue() == $amt2.doubleValue())
then
System.out.println(Repayment Code Requires Approval);
processMDAdjustments(drools.getWorkingMemory().getQueryResults(
MD Adjustments ), StatusConstants.APPROVAL);
System.out.println(mdOutput:  + mdOutput);
end

If I remember correctly, there was going to be an update to the rules
language that would allow me to eliminate the eval.  Is this true and if so
what is the syntax that accomplishes this?

Ron

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


Re: [rules-users] Re: 4.0 Language Updates

2007-07-09 Thread Edson Tirelli

  Ronald,

  Yes, this is one way (I would say probably the preferred way) of doing
it.
  For BigDecimals, drools will use equals() method.

  Look at the BigDecimalFactory class for details.

  []s
  Edson

2007/7/9, Ronald R. DiFrango [EMAIL PROTECTED]:


OK, I think I found it and here is what the rule could look like:

rule Repayment Code Requires Approval
salience 60

when
repaymentCode : RepaymentCode( code == MD, matchApprv == Y )
mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, sumCmAndRnr
== $amt1)
then
System.out.println(Repayment Code Requires Approval);
processMDAdjustments(drools.getWorkingMemory ().getQueryResults(
MD Adjustments ), StatusConstants.APPROVAL);
System.out.println(mdOutput:  + mdOutput);
end

Now my question is, how does Drools handle these objects and the
comparison because the underlying objects are BigDecimal?

On 7/9/07, Ronald R. DiFrango [EMAIL PROTECTED] wrote:

 All,

 I have the following rule:

 rule Repayment Code Requires Approval
 salience 60

 when
 repaymentCode : RepaymentCode( code == MD, matchApprv == Y )

 mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty, $amt2 :
 sumCmAndRnr)
 eval($amt1.doubleValue() == $amt2.doubleValue())
 then
 System.out.println(Repayment Code Requires Approval);
 processMDAdjustments(drools.getWorkingMemory().getQueryResults(
 MD Adjustments ), StatusConstants.APPROVAL);
 System.out.println(mdOutput:  + mdOutput);
 end

 If I remember correctly, there was going to be an update to the rules
 language that would allow me to eliminate the eval.  Is this true and if so
 what is the syntax that accomplishes this?

 Ron



___
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] JBoss Drools vs JBoss Rules

2007-07-09 Thread Hamu, Dave
Mark,

As a long-time member of Jboss Rules/Drools community, first, I want to
thank the team for quoting me in the Drools 3.0 documentation.  It's
nice to know that there are people in the community who respect my
opinions.  I didn't realize that my comments made it into the document,
but I'm honored.

In regard to the name game...

I have to admit that as an old-timer, I had some difficulty switching to
the Jboss Rules moniker.  Overall, I prefer the Drools branding, due to
the fact that it harkens back to the history of the technology that the
Drools team developed.  

Speaking of history  age, my age and subsequent memory loss prevents me
from recalling the genesis of the Drools name.  Was it an abbreviation
of a sorts for Declarative Rules?  

- Dave



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Monday, July 09, 2007 7:45 AM
To: Rules Users List; Rules Dev List
Subject: [rules-users] JBoss Drools vs JBoss Rules

http://markproctor.blogspot.com/2007/07/jboss-drools-vs-jboss-rules.html
Feedback welcome please :)

Mark
___
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] Re: 4.0 Language Updates

2007-07-09 Thread Edson Tirelli

  Ronald,

  Take a look at the class and it will be easy to understand:

http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/BigDecimalFactory.java

   != for big decimals is translated to

return ! val1.equals( val2 );

  In both cases, it is delegating to the object equals() method, that in
case of BigDecimal, compare values, not references ( identity ).

  []s
  Edson

2007/7/9, Ronald R. DiFrango [EMAIL PROTECTED]:


On a similiar note what if you do:

BigDecimal != 0

On 7/9/07, Ronald R. DiFrango [EMAIL PROTECTED]  wrote:

 Thanks Edson!

 Does the equals methods compare the underlying values or the object
 references?

 On 7/9/07, Edson Tirelli  [EMAIL PROTECTED] wrote:
 
 Ronald,
 
 Yes, this is one way (I would say probably the preferred way) of
  doing it.
 For BigDecimals, drools will use equals() method.
 
 Look at the BigDecimalFactory class for details.
 
 []s
 Edson
 
  2007/7/9, Ronald R. DiFrango [EMAIL PROTECTED] :
  
   OK, I think I found it and here is what the rule could look like:
  
   rule Repayment Code Requires Approval
   salience 60
  
   when
   repaymentCode : RepaymentCode( code == MD, matchApprv ==
   Y )
   mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty,
   sumCmAndRnr == $amt1)
   then
   System.out.println(Repayment Code Requires Approval);
   processMDAdjustments( drools.getWorkingMemory().getQueryResults( MD 
Adjustments ),
   StatusConstants.APPROVAL);
   System.out.println(mdOutput:  + mdOutput);
   end
  
   Now my question is, how does Drools handle these objects and the
   comparison because the underlying objects are BigDecimal?
  
   On 7/9/07, Ronald R. DiFrango  [EMAIL PROTECTED] wrote:
   
All,
   
I have the following rule:
   
rule Repayment Code Requires Approval
salience 60
   
when
repaymentCode : RepaymentCode( code == MD, matchApprv ==
Y )
mdOutput : ModelDiscrepancyOutput( $amt1 : sumRTVQty,
$amt2 : sumCmAndRnr)
eval($amt1.doubleValue() == $amt2.doubleValue())
then
System.out.println(Repayment Code Requires Approval);
processMDAdjustments(drools.getWorkingMemory().getQueryResults(
MD Adjustments ), StatusConstants.APPROVAL);
System.out.println(mdOutput:  + mdOutput);
end
   
If I remember correctly, there was going to be an update to the
rules language that would allow me to eliminate the eval.  Is this true 
and
if so what is the syntax that accomplishes this?
   
Ron
   
  
  
   ___
   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





--
 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] 4.0 JBoss Rules IDE - JDK 1.4 compiler setting

2007-07-09 Thread Ronald R. DiFrango

All,

I had to change the compiler setting from JDK 5.0 to JDK 1.4 and no all of a
sudden my DRL files give me the following error:

Severity and DescriptionPathResourceLocationCreation Time
Id
Syntax error, static imports are only available if source level is 5.0
RtvDecisionEngine/src/rules/com/circuitcity/rtvcrms/rules
modelDiscrepancyRules.drlline 20118400666338277860

On all rules.

Thoughts?

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


Re: [rules-users] 4.0 JBoss Rules IDE - JDK 1.4 compiler setting

2007-07-09 Thread Mark Proctor
On M3? if you look at the JavaDialect you should see that the source is 
always set ti jdk1.5, can never go below that, but the target is 1.4 - 
which should allow static imports in a jdk1.4 environment. The unit 
tests for it are working, maybe you can look into debugging this one for me?


Mark
Ronald R. DiFrango wrote:

All,

I had to change the compiler setting from JDK 5.0 to JDK 1.4 and no 
all of a sudden my DRL files give me the following error:


Severity and DescriptionPathResourceLocationCreation 
TimeId
Syntax error, static imports are only available if source level is 
5.0RtvDecisionEngine/src/rules/com/circuitcity/rtvcrms/rules
modelDiscrepancyRules.drlline 20118400666338277860


On all rules.

Thoughts?

Ron



___
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] 4.0 JBoss Rules IDE - JDK 1.4 compiler setting

2007-07-09 Thread Ronald R. DiFrango

Mark,

I would be happy to help.  The short answer is that, I need my entire
project - Java classes and all in JDK 1.4 format.  When I tried playing with
the settings in Eclipse it keeps telling me that either source or class
files that are generated must be at or above the other's level.  It does not
look like I can mix and match the two of them.

I guess my alternative would be to create an ANT script that generated the
1.4 JAR file.  BTW..it does run just fine and like a champ!

Ron

On 7/9/07, Mark Proctor [EMAIL PROTECTED] wrote:


 On M3? if you look at the JavaDialect you should see that the source is
always set ti jdk1.5, can never go below that, but the target is 1.4 -
which should allow static imports in a jdk1.4 environment. The unit tests
for it are working, maybe you can look into debugging this one for me?

Mark
Ronald R. DiFrango wrote:

All,

I had to change the compiler setting from JDK 5.0 to JDK 1.4 and no all of
a sudden my DRL files give me the following error:

Severity and DescriptionPathResourceLocationCreation
TimeId
Syntax error, static imports are only available if source level is 5.0
RtvDecisionEngine/src/rules/com/circuitcity/rtvcrms/rules
modelDiscrepancyRules.drlline 20118400666338277860

On all rules.

Thoughts?

Ron

--

___
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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users