Hide Forgot
Created attachment 527200 [details] using nested enums and enums on nested facts Description of problem: Dropdown list with enumeration values is missing, if you use a fact model with nested fact and enumeration for the nested fact's field. I use the two "types" of enumerations - one defined on a fact that's nested into another fact in the model and one nested, defined directly on the topmost fact and listing values for the subfact's field - see below. Model used: declare Subfact1 enumfield1: String end declare Subfact2 enumfield2: String end declare Fact1 subfact1field: Subfact1 end declare Fact2 subfact2field: Subfact2 end Enumeration used: 'Fact1.subfact1field.enumfield1' : ["val1a", "val1b"] 'Subfact2.enumfield2' : ["val2a", "val2b"] When I try to use these facts in a guided rule, the dropdown enumeration list is not shown, i get a simple edit box instead. This applies to these cases: 1) Adding 'Fact1' and it's field 'subfact1field', then the field within that, 'enumfield1'. Selecting a literal value for 'enumfield1'. 2) Adding Fact1 and choosing Expression editor - then adding 'subfact1field' and 'enumfield1'. Selecting a literal value for 'enumfield1', again. 3) and 4) as above, but for 'Fact2' and corresponding fields. 5) Adding 'Fact1' and binding it to variable, let's say 'f1'. Then adding 'From' and choosing 'f1'. Adding a pattern of 'Subfact1' and its field 'enumfield1' and, again, matching it with a literal value. Though 5) is a workaround for the issue if used with 'Fact2' and its fields. See the screenshot if it doesn't seem clear. Version-Release number of selected component (if applicable): BRMS 5.2.0 ER5 Additional info: by manstis: > ...an unreported problem remains: using enumerations on nested models (e.g. > ParentType.ChildType.enumField == XYZ). ... 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. ...there is a work-around and it is *possibly* an edge case.
Fix made and backported to 5.3.x branch. Note: The fix also improved upon the solution for the original BZ issue (for which this one captured the last "...unreported problem" - see Addition info section). I would encourage you to test fully.
Please verify this issue on ER5.
A few things were fixed, but not all, see the new screenshot, it should explain all. Basically, enumerations on nested facts are ok, nested enumerations are not. Cases 3 and 4 are fixed and 5 for Fact2 also.
Created attachment 571735 [details] better nested enums, halfway there
Created attachment 571748 [details] Results found locally
Created attachment 572722 [details] repo export Repository export with the model and enumeration used plus a test rule showing the bug.
As it was finally resolved, enumeration of the type "Fact1.subfact1field.enumfield1" are not supported, so this is okay.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: The drop down menu for nested enumerations in the guided rule editor was previously not shown. This issue has been resolved and the drop down menu is now available.