[jboss-jira] [JBoss JIRA] Assigned: (JBRULES-3065) Facts currently have to be Java Beans, but Mark has used POJOS, except the attached example does not work.

Michael Anstis (JIRA) jira-events at lists.jboss.org
Thu Sep 29 03:42:26 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Anstis reassigned JBRULES-3065:
---------------------------------------

    Assignee: Edson Tirelli  (was: Michael Anstis)


Hi Edson, Mark assigned this to me (presumably because it mentions the word "spreadsheet"). I've had a look and it appears more related to a problem with field accessors on POJOs. If I'm wrong and you see this as something for me then please bounce back. Cheers, Mike

> 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: Edson Tirelli
>         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