Bug 724198 (BRMS-141)

Summary: When there are 2 bound variables in a guided rule, and you map a third fact with one of the attribute, then there a blank screen and the guided rule never shows again
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jaroslaw Kijanowski <kijanowski>
Component: BRM (Guvnor)Assignee: Toni Rikkola <toni>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 5.0.0 GA   
Target Milestone: ---   
Target Release: 5.0.2   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-141
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-23 11:49:41 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:

Description Jaroslaw Kijanowski 2009-06-22 17:12:20 UTC
Date of First Response: 2009-08-26 11:46:49
securitylevel_name: Public

Comment 1 Jaroslaw Kijanowski 2009-06-22 17:12:46 UTC
Link: Added: This issue depends GUVNOR-362


Comment 2 Jervis Liu 2009-08-26 15:46:49 UTC
Corresponding Guvnor Jira has been closed by Toni.

Comment 3 Jaroslaw Kijanowski 2010-03-23 11:49:41 UTC
Verified in BRMS 5.0.2 CR1

Comment 4 Dana Mison 2010-04-20 09:33:15 UTC
Sorry I need more information for this JIRA for the release notes.  

Consequence - The user would encounter this when?
"if a rule had two facts each with bound variables, adding a fact with an attribute set to one of the bound variables of the other two facts"  
Is that an accurate description ?  (I'm not familiar with "bound variables" )

Can you please clarify: "then there a blank screen and the guided rule never shows again"

Cause:
What was going wrong here generally ?  eg. value was not checked for null, only reading the first element in the list etc

Fix & Result:
Did anything have to be changed other than "fixing the cause"?  Is there any new behavior aside from "now works as expected" ?


Comment 5 Toni Rikkola 2010-04-21 10:56:21 UTC
Consequence
User adds a Car pattern and gives it a variable name AA
User adds another pattern called Address and gives it a variable name BB
User adds a third fact called Person and he tries to check if persons address is BB. ( Person.address == BB )

This causes a problem in the code. I saw nothing visible after I did the steps, but after I saving it I tried to reopen it and the editor could not open anymore. Other editors worked fine.

Cause:
There are two variables in the rule and the types are different. Another one is Car and another one is Address. 
When the editor is refreshed the code counts every pattern variable in the rule and thinks that they are in the restriction list box and that they can be compared to Person.address field. Because BB is the second variable in the rule, the code counts up to two and tries to set that as the selected index. This is where it fails, since there is no such index in the list box.

Fix:
The list box contains only one variable and that is correct. 
Fix makes it count only the variables of type Address, because the field can only be compared to Address objects.