[rules-users] Problem in using dsl.

Parit Bansal parit.bansal at gmail.com
Thu Sep 27 05:59:12 EDT 2007


hi,

I wrote the follwoing dsl file:

#trying a new way of writing.
[when]beanObject has a flavour not equal to "{status}"=beanObj : XMLDataBean
(flavour  != "{status}")
[then]set the "{Flavour}" dimension.=beanObj.setDimsAndVals("{Flavour}",
beanObj.getFlavour());
[then]set the "{language}" dimension to
"{kannada}"=beanObj.setDimsAndVals("{language}",
"{kannada}");
[when]beanobject has a songCode not equal to "{yes}"=beanObj : XMLDataBean
(songCode  != "{yes}")
[then]set the "{SongCode}" dimension in
beanObject=beanObj.setPropsAndVals("{SongCode}",
beanObj.getSongCode());
[then]set the category to "{category}"=beanObj.setCategory("{category}");
[then]set the "{album}" dimension=beanObj.setDimsAndVals("{album}",
beanObj.getMovie());
[when]beanObject has a dimension "{dimension}"=beanObj :
XMLDataBean("{dimension}")
[when]beanObject has a "{category}"=beanObj : XMLDataBean ("{category}")
[when]set language=beanObj : XMLDataBean(language)

and the corresponding drl file is:

import com.dataBean.XMLDataBean;
expander bollywood.dsl

rule "catgy rule 1"
    agenda-group "cat";
    when
    beanObject has a "category"
    then
        set the category to "Regional"
end

rule "dim rule 1"
    agenda-group "dimension";
    when
        beanObject has a dimension "movie"
    then
        set the "Album-Movie" dimension
end

rule "dim rule 2"
    agenda-group "dimension";
    when
        beanObject has a flavour not equal to "NA"
    then
        set the "Flavour" dimension
end

rule "dim rule 3"
    agenda-group "dimension";
    when
        beanObject has a dimension "language"
    then
        set the "Language" dimension to "Kannada"
end

rule "property rule 1"
    agenda-group "dimension";
    when
        beanobject has a songCode not equal to "Y"
    then
        set the "Song Code" dimension in beanObject
end

I tried to compile the drl file but it gives errors:

Unexpected token "category"
Unexpected token "movie"
Unexpected token "language"

I have gone through some sample applications but looking at the above errors
am having no clue why these compilation errors are happening. Please help.

-- 
Parit Bansal
Graduate Student
DhiruBhai Ambani Institute Of Information and Communication Technology
Gandhinagar- 382007 India
Email: parit.bansal at gmail.com
Web: http://www.guptalab.org/paritbansal/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070927/8584274b/attachment.html 


More information about the rules-users mailing list