Red Hat Bugzilla – Bug 742149
Enumerations in rules not showing
Last modified: 2013-06-26 21:15:17 EDT
Created attachment 525491 [details]
after step 4
Description of problem:
Enumerations are not working in Business Rules.
Version-Release number of selected component (if applicable):
Private QA build, post ER4, should have all the changes CR1 should have
Steps to Reproduce:
I have a POJO model with fact Person with fields age, name & sex.
1. Create an Enumeration:
2. Create a rule,
3. add a condition: Person ... then click the row and add a restriction on field sex. Choose "equal to" operator.
4. Click the pencil to add a value, choose Literal value.
No field or drop down box for choosing a value is visible. Value cannot be added.
It should be possible to choose a literal value from a drop down box.
Furthermore - if I then click the "Add more options to this field values", the whole condition disappears along with the "THEN" section and nothing can be added to the rule.
Created attachment 525492 [details]
after step 4 and clicking Add more options...
Created attachment 525493 [details]
The reported problem has been fixed and pushed to 5.2.x branch however an unreported problem remains: using enumerations on nested models (e.g. ParentType.ChildType.enumField == XYZ). I have attached a screen shot that hopefully explains it better than lots of words. The problem is caused by enumerations being driven by the parent Fact type (which in part is to support linked enums, where the value of one depends on another). It is not a simple fix. My recommendation would be to have this BZ issue in 5.2 and perhaps raise another to fix the other problem I report for 5.3 (there is a work-around and it is *possibly* an edge case).
Created attachment 525648 [details]
screen shot showing issue of nested fact type enumerations.
Works well, thanks. Will look at the issue you mentioned and create a new BZ.
Great :) I just noticed that the screen shot misses one case: using an expression with a non-nested enumeration works as well - the problem is just when you have a nested field enumeration.