[rules-users] Looping in When part

2011-10-04 Thread rahulkrishnan
Hi I want to match a string with the contents of hashmap. The process is like this. Let the string is abcd First it will search for abcd in the map if found i have to assign it to a variable else i has to remove the last alphabet (abc) and have to match with hashmap like is the process. My

Re: [rules-users] Looping in When part

2011-10-04 Thread Wolfgang Laun
You'll need 2 rules, one for truncating a key that does not match and another one for handling the match. If you have to handle absolute failure (not even a matches) you'll need a third rule and a more complex fact for storing the original and the truncated string. These 2 rules are untested: