Business Rules may not be handling Java Enums Correctly, DRL Generated does not work and
Running Test Scenarios fails
---------------------------------------------------------------------------------------------------------------------
Key: JBRULES-2725
URL:
https://jira.jboss.org/browse/JBRULES-2725
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-guvnor
Affects Versions: 5.1.1.FINAL
Environment: Windows 7 (64 Bit)
Sun JDK 1.6.0 Update 21
Reporter: Daniel Cruver
Assignee: Mark Proctor
I have created POJO Model Jar for importing into Guvnor.
I can create A Business Rule (Guided Editor), it correctly allows me to set enumeration
values and it validates correctly.
But when I go to view source:
In the when clause, it shows that it has converted the enumeration of VehicleType.AIR to
"0" which is the cardinal value in quotes.
In the then clause, it shows that it has converted the enumeration of VehicleType.AIR to 0
which is the cardinal value as an integer.
Whenever I create a unit test with this rules and define facts I get this error:
Unable to run the scenario.
[Error: could not access/write property (type) in: com.example.model.Vehicle] [Near : {...
__fact__.type = __val_ ....}] ^ [Line: 1, Column: 0]
I have taken these generated DRL as given be Guvnor and tried to run them in a test
driver.
Using the rules as given it will not activate the rules, I have to replace the
"0" and 0 with VehicleType.AIR in order for it to fire the rules.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira