[rules-users] Type declaration in DSL

Matt Geis mgeis at yahoo.com
Thu Aug 6 16:15:52 EDT 2009


You just need to create a mapping like..

There is a product type = productType : ProductType()
There is a customer = customer : Party()

and you can write the LHS of the rule like
when
         >not PricingResult()
        There is a product type
        There is a customer

Matt

*********************
hi all,

I have recently started using Drools 5.0 .I have a difficulty in
writing the expressions in DSL file.i have my .dslr file written like
this

when
         >not PricingResult()
         >productType : ProductType()
         >customer : Party()
    then
        create a PricingResult
        set productType
        set customer

now, i am able to fire the rule successfully,with the following in
.dslr file with rule language mappings set to

pricingResult.setProductType(productType);
pricingResult.setCustomer(customer);

where productType and customer are set using CommandFactory.insert(....)

but
i want to remove the below 2 lines from .dslr file and expand them in .dsl file

productType : ProductType()
customer : Party()

how do i declare these types in DSL?


      



More information about the rules-users mailing list