[rules-users] checking string property for key-words

Frank Langelage frank at lafr.de
Mon Mar 19 10:44:20 EDT 2012


Hello,

I'm working on module checking and processing incoming mails.
I'd like to use drools expert to check the mails and determine the 
target folder for the further processing.

So one of the first things is to check the subject of mail for keywords.
I'm using decision tables.

The first shot was to use regular expressions for this.
CONDITION		ACTION
javax.mail.Message
subject matches "$1"	insert(new String("$1"));
.* [Ss]pam .*		Spam
.* Order .*		Orders/inbox
.* Activity .*		Workflow/inbox

This works so far, but I'm not totally happy with this regular expressions.
I'd prefer to see only the key-word in the cells.

CONDITION		ACTION
javax.mail.Message
???????????		insert(new String("$1"));
spam			Spam
Spam			Spam
Order			Orders/inbox
Activity		Workflow/inbox

But what to fill in for the ????? ?




More information about the rules-users mailing list