[rules-users] Usage of List in Drools 5.5.0

Rajeswari Devadass rajeswari at raremile.com
Wed Jul 2 06:23:02 EDT 2014


Created a Model in Guvnor 5.5.0 with 3 fields - 2 Text, 1 java.util.List
The model is verified and validated - correctly.
Source looks like below
declare FormatConfig
            fieldName: String
            regEx: String
            regExPatterns: java.util.List
end

While trying to create a Business Rule using the above created Model. The
rule gets fired and works fine.
rule "MyFormat"
    dialect "mvel"
            when
        config : FormatConfig( fieldName == "AMOUNT" )
    then
        config.setRegEx( "123" );
         retract( config );
end

But, the moment I try to use the List, by only declaring a List in the
"When" section, the rule stops working.
rule "MyFormat"
    dialect "mvel"
            when
        config : FormatConfig( fieldName == "AMOUNT" )
regExPatterns1: java.util.List ( )
    then
        config.setRegEx( "123" );
         retract( config );
end

My final intention is to modify the regExPatterns list in the "THEN" block
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140702/dce87ea1/attachment.html 


More information about the rules-users mailing list