Bug 995085

Summary: Guided Decision Table, enumerations: only the last option is visible
Product: [Retired] JBoss BRMS Platform 6 Reporter: Zuzana Krejčová <zkrejcov>
Component: Business CentralAssignee: manstis
Status: CLOSED NOTABUG QA Contact: Radovan Synek <rsynek>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: lpetrovi
Target Milestone: ER4   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-22 13:41:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zuzana Krejčová 2013-08-08 13:59:41 UTC
Description of problem:
In 6.0, enumeration support has been added to the Decision Tables. If you use a field that has an enumeration defined on it, you correctly cannot define the optional value list. You get a select box for the default value right away, but this select box is not populated as it should be.

For a Fact with a field and an enumeration defined as 'Fact.field' : 'a=valueA','b=valueB','c=valueC', only the last option, 'valueC' is available.
(The same for enumeration 'Fact.field' : 'valueA','valueB','valueC')

This issue is in Guided Decision Tables and the Wizard for creating them.


Version-Release number of selected component (if applicable):
kie-wb 6.0 CR1

Comment 1 manstis 2013-08-29 18:33:11 UTC
I cannot replicate with (Community) CR2. Can you please confirm the problem of only being able to select the last item in an enumeration for "Default Value" remains? If you can replicate the problem please provide steps how to reproduce fully. Thanks.

Comment 2 Zuzana Krejčová 2013-08-30 08:18:47 UTC
(In reply to manstis from comment #1)
> I cannot replicate with (Community) CR2. Can you please confirm the problem
> of only being able to select the last item in an enumeration for "Default
> Value" remains? If you can replicate the problem please provide steps how to
> reproduce fully. Thanks.

I tried this with the community CR2 and with the product ER2. In both version I see this bug.

Step to take:
1. Create a new project.
2. In this project, create a new fact through the Data Modeler - public class Fact... private java.lang.String field;...
3. Save the model. Optionally refresh the browser to be able to see the new file.
4. Create a new Enumeration - source should show this: 'Fact.field' : 'a','b','c' - save again.
5. Create a new Guided Decision Table (no wizard this time) and add a new condition column.
6. Set the Pattern to 'Fact', choose a binding. Set the field to 'field' and operator to 'equal to'. Fill in some header.
7. Click the Default value select box.

You will see options 'Choose...'  and 'c' only. If you add that column, you won't be able to select any other option than 'c' in the table itself either.

Comment 3 manstis 2013-08-30 10:25:39 UTC
You're enumeration definition is wrong.

If you define it as 'Fact.field' : ['a','b','c'] the "Default Value" drop-down works correctly. Defining it as you have 'Fact.field' : 'a','b','c' doesn't create an array for possible values.

The syntax for enumerations is covered in the User Guide .

Comment 4 Zuzana Krejčová 2013-08-30 10:47:50 UTC
(In reply to manstis from comment #3)
> You're enumeration definition is wrong.
> 
> If you define it as 'Fact.field' : ['a','b','c'] the "Default Value"
> drop-down works correctly. Defining it as you have 'Fact.field' :
> 'a','b','c' doesn't create an array for possible values.
> 
> The syntax for enumerations is covered in the User Guide .

Oh yeah, sorry for that - I foolishly trusted the validation in there and forgot this little bit. Expect another BZ about validation then. :)

Comment 5 manstis 2013-08-30 10:49:06 UTC
hehe, no problem - although (1) I'd recommend the new BZ asks for more general improvement to the Enumeration Editor, (2) it isn't a blocker.