[rules-users] Error writing DSL

kissro at lidp.com kissro at lidp.com
Thu Sep 13 12:02:41 EDT 2007


In eclipse, I have this coded in a .dsl

There is a Policy                      p:Policy()
for a male                             sex = "m"
with a premium less than {premium}     premium < {premium}
Accept policy                          p.setStatus(32)

My .dslr rule file contains this

rule "Low Premium"
        when
                There is a Policy
                for a male
                with a premium less than 50.00
        then
                Accept policy
end


The .drl view shows this

rule "Low Premium"
        when
        p : Policy()
        sex = "m"
        premium < 50.00
        then
        p.setStatus(32);
end


I'm getting the error - Unexpected token 'sex'.  I tried removing the
'for a male' part leaving 'with a premium less than 50.00' but then
I get 'Unexpected token 'premium''.  How do I code the .dsl and/or .dslr
files to get the expected results.

Thanks,

Rod  




More information about the rules-users mailing list