[jboss-jira] [JBoss JIRA] Created: (JBRULES-3065) Facts currently have to be Java Beans, but Mark has used POJOS, except the attached example does not work.
Jim Tyrrell (JIRA)
jira-events at lists.jboss.org
Mon Jun 6 16:37:59 EDT 2011
Facts currently have to be Java Beans, but Mark has used POJOS, except the attached example does not work.
----------------------------------------------------------------------------------------------------------
Key: JBRULES-3065
URL: https://issues.jboss.org/browse/JBRULES-3065
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Jim Tyrrell
Assignee: Mark Proctor
Attachments: Screen shot 2011-06-06 at 2.02.00 PM.png, Screen shot 2011-06-06 at 2.02.14 PM.png, Screen shot 2011-06-06 at 2.02.37 PM.png, SimpleSpreadSheetBasedPOJO.java, SimpleSpreadSheetBasedTest.drl, SimpleSpreadSheetBasedTest.java
When modeling spreadsheets for form/spreadsheet validation, see the attached screen shots, all of the tools use the convention of A, B, C for the column names (Open Office, Excel, and Numbers). When trying to create an object with variable names of A, B, etc, I get errors in the JBDS as the below:
Description Resource Path Location Type
BuildError: Unable to create Field Extractor for 'A' of '[ClassObjectType class=com.sample.SimpleSpreadSheetBasedPOJO]' in rule 'Validation 1' SimpleSpreadSheetBasedTest.drl /BugProject/src/main/rules line 16 Drools Error
No amount of massaging can get this error to go away.
When I run the attached classes, I get the following error message:
Unable to create Field Extractor for 'A' of '[ClassObjectType class=com.sample.SimpleSpreadSheetBasedPOJO]' in rule 'Validation 1' : [Rule name='Validation 1']
java.lang.IllegalArgumentException: Could not parse knowledge.
at com.sample.SimpleSpreadSheetBasedTest.readKnowledgeBase(SimpleSpreadSheetBasedTest.java:48)
at com.sample.SimpleSpreadSheetBasedTest.main(SimpleSpreadSheetBasedTest.java:23)
Even though a getter and setter method is available.
So I created an ID field, this seems to work fine, but if I create a field A1, this does not, if I create ID1, this seems to work...so something is amiss in the way in which fields, methods, etc are marshaled.
If a Java Bean is required that is fine, but then we need to retreat from marketing POJOs as facts, and also possibly create a better error message that tells us to use Java Beans and not POJOs.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list