0
votes

I am creating rules through the drools-guvnor. I have imported my POJO model and everything is set up correctly (I have done tests) but I cant seems to figure out how to get the "matches" operator working correctly. This is what I have so far(source code):

rule "invilidSms"
dialect "mvel"
    when
        invalidSms : Policy( SMS_Area_Code matches "[0-9]{4,}" || matches "^[0-9]{0,2}" || matches "[0-9\\D]+" , SMS_TelNumber matches "[0-9]{4,}" || matches "^[0-9]{0,2}" || matches "[0-9\\D]+" , SMS_nixieindicator == "Y" || == "y" )
    then
        invalidSms.setSms( ""Invalid area code"" );
end

Could anyone give me any tips on using multiple regex checks in drools-guvnor or some way of getting this to work. It seems as though their forum is really stale. Most of the answers I could find on there haven't been answered.

Any help would be appreciated.

1

1 Answers

0
votes

you could try to pipe the regular expressions only. something like:

rule "invilidSms"
dialect "mvel"
when
    invalidSms : Policy( SMS_Area_Code matches "[0-9]{4,}|^[0-9]{0,2}|[0-9\\D]+" , SMS_TelNumber matches "[0-9]{4,}|^[0-9]{0,2}|[0-9\\D]+" , SMS_nixieindicator matches "[Yy]"
then
    invalidSms.setSms( ""Invalid area code"" );
end