[rules-users] Error in Guvnor with Enumerations (5.1.1)

John Peterson john.peterson.gv3k at statefarm.com
Thu Aug 11 14:59:35 EDT 2011


Hi,

I'm trying to utilize a "load method" for Guvnor, but I can't seem to get it working.  His is my DataHelper class (modeling it off the documentation):

package com.enumerations;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class DataHelper {

        public List<String> getQuestionNumberList(){
                ArrayList returnList = new ArrayList();

                Iterator it = com.enumerations.DroolsTest.questionList.iterator();
                while (it.hasNext()){
                        QuestionAndAnswer qAndA = (QuestionAndAnswer)it.next();
                        if (!returnList.contains(qAndA.getQuestionNumber())){
                                returnList.add((String)qAndA.getQuestionNumber());
                        }
                }
                return (List<String>)returnList;
        }
}

I've placed this (both as a .jar and .class file) in my JBoss installation under \jboss-4.2.3.GA\server\default\deploy\drools-guvnor.war\WEB-INF\classes\com\enumerations.

Using this syntax as an enumeration in Guvnor:

'QuestionAndAnswer.questionNumber' : (new com.enumerations.DataHelper()).getQuestionNumberList()

I get the following errors:

[Enumerations] Unable to load enumeration data.
[Enumerations] [Error: failed to access property: getQuestionNumberList(): [Error: unable to invoke method: getQuestionNumberList] [Near : {... Unknown ....}] ^[Line: 1, Column: 0]][Near : {... r()).getQuestionNumberList() ....}] ^ [Line: 1, Column: 0]
[Enumerations] Error type: org.mvel2.PropertyAccessException

I am using Drools 5.1.1.  Does anyone have any suggestions on what to do to correct this error?

jp

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110811/5a69ce06/attachment.html 


More information about the rules-users mailing list