Bug 744719

Summary: Guided editor: non-functional nested enumerations and enumerations on nested models
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Zuzana Krejčová <zkrejcov>
Component: BRM (Guvnor)Assignee: manstis
Status: VERIFIED --- QA Contact: Lukáš Petrovický <lpetrovi>
Severity: low Docs Contact:
Priority: unspecified    
Version: BRMS 5.2.0-ER1CC: lpetrovi, manstis
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
using nested enums and enums on nested facts
none
better nested enums, halfway there
none
Results found locally
none
repo export none

Description Zuzana Krejčová 2011-10-10 10:06:43 UTC
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.

Comment 1 manstis 2012-02-27 12:29:29 UTC
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.

Comment 2 Ryan Zhang 2012-03-21 09:55:31 UTC
Please verify this issue on ER5.

Comment 3 Zuzana Krejčová 2012-03-21 14:57:41 UTC
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.

Comment 4 Zuzana Krejčová 2012-03-21 14:58:33 UTC
Created attachment 571735 [details]
better nested enums, halfway there

Comment 5 manstis 2012-03-21 15:38:41 UTC
Created attachment 571748 [details]
Results found locally

Comment 9 Zuzana Krejčová 2012-03-26 09:38:03 UTC
Created attachment 572722 [details]
repo export

Repository export with the model and enumeration used plus a test rule showing the bug.

Comment 12 Zuzana Krejčová 2012-03-27 10:43:32 UTC
As it was finally resolved, enumeration of the type "Fact1.subfact1field.enumfield1" are not supported, so this is okay.

Comment 14 lcarlon 2012-06-04 00:43:54 UTC
    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.