[rules-users] regular expresions

2008-02-08 Thread Brian Trezise
For the following line of code in the LHS of a rule, is it possible to save the matched string, and/or the starting and ending index of said match? sd : SmartDescription(description matches "", description : description) ___ Brian Trezise Staff S

Re: [rules-users] Re: Pattern matching

2008-02-08 Thread Edson Tirelli
Ok, I see the problem. It is a bug that happens when mixing alpha and beta constraints under ||. I will fix it. []s Edson 2008/2/8, Jai Vasanth <[EMAIL PROTECTED]>: > > Sorry... eval(reason == 'override') is not the right way to check for > string equality doh. Yes yours is definit

[rules-users] Re: Pattern matching

2008-02-08 Thread ST
Perhaps the comparison problem is related to the bug reported by Len. See the thread named, "boolean == String". http://jira.jboss.org/jira/browse/JBRULES-1451 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/list

Re: [rules-users] Re: Pattern matching

2008-02-08 Thread Jai Vasanth
Sorry... eval(reason == 'override') is not the right way to check for string equality doh. Yes yours is definitely the way to go. I have had the '==' work for many cases. In this case it seems to be not working when there are multiple boolean disjunctions along with them. Jai On Feb 8, 2008 8:52

RE: [rules-users] compare string and int in LHS

2008-02-08 Thread brenner
Thanks for your answer. Yes, with eval it works. I had oversight it. The question with the model I have aked myself. But I can't change it. There are to much factors involved. Storable by Hibernate. Based on configuration files with key-value, whereas the value could have various data types (c-t

Re: [rules-users] Re: Pattern matching

2008-02-08 Thread Jai Vasanth
Very interesting. I tried it too , I dont think its about the '==' because it seems to be working for eval( reason == 'override'). So it is more to do with having the eval method call. Nice find. Not too sure if this is a bug, or if there is a reason why drools works this way. Thanks Jai On Feb

RE: [rules-users] compare string and int in LHS

2008-02-08 Thread Anstis, Michael (M.)
You could use an inline eval too. The problem possibly lies more with your model; why not have one subclass expose the String property and another the Integer property and code the rules using the subclasses? Much safer throughout the entire application than having to worry whether some field is m

[rules-users] Re: rules-users Digest, Vol 15, Issue 16

2008-02-08 Thread siddhartha banik
Hi, Sorry, the Problem statement did not come with the attchment. The problem is: I am serializing working memory(WM). But after deserializing that, if I try to modify the corresponding RuleBase that is not getting reflected. I mean, after loading the serialized WM even I add a package to the cor

Re: [rules-users] compare string and int in LHS

2008-02-08 Thread brenner
Hi, I have found a solution, but I don't know that it is the best: My solution: I have extend my Class with a method which returns the string as a integer. And my rule is like this: i : Integer( intValue <= 1) from $test.getValue(Test.VALUE_TYP_INTEGER); Is that the only/best solution. Can't

Re: [rules-users] java.lang.ClassCastException comparing BigDecimals (compareTo)

2008-02-08 Thread José Arrarte
Hello again. I was out of office, sorry for not answering sooner... I've opened a JIRA issue, #1433, with a test case and a full stack trace desciption: http://jira.jboss.com/jira/browse/JBRULES-1433 Best regards, José Arrarte On Jan 30, 2008 9:55 AM, Edson Tirelli <[EMAIL PROTECTED]> wrote: >

[rules-users] compare string and int in LHS

2008-02-08 Thread brenner
Hi, I have a class, wich contains a string value. This value is in some use cases an integer. For this use case I want to convert (parse) the string typ to an integer because I want that the following rule matches: rule when t : Test(value <= 1) then System.out.println(t) end cla