Reposting since I didn't get any takers. I'm hoping it might have been because I
sent it to the list on a Friday afternoon (2 weeks ago).
Hey,
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
Show replies by date