Bug 744737 - Guided editor: problematic removing of variable binding
Summary: Guided editor: problematic removing of variable binding
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor)
Version: BRMS 5.2.0-ER1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: BRMS 5.3.0.GA
Assignee: manstis
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-10 10:59 UTC by Zuzana Krejčová
Modified: 2020-04-27 01:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
removed field variable, viewing source (19.77 KB, image/png)
2011-10-10 12:02 UTC, Zuzana Krejčová
no flags Details
validatind after removing field variable (24.62 KB, image/png)
2011-10-10 12:03 UTC, Zuzana Krejčová
no flags Details
validation after removing fact variable for first condition in the rule (13.60 KB, image/png)
2011-10-10 12:04 UTC, Zuzana Krejčová
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 757167 0 unspecified VERIFIED Decision Table Wizard lets user create an empty binding 2021-02-22 00:41:40 UTC

Internal Links: 757167

Description Zuzana Krejčová 2011-10-10 10:59:34 UTC
Description of problem:
In the Guided rules editor, facts and fields can be bound to variables. The only way to remove that binding is to bind it to a new variable that is an empty string. This causes some problem with the rule source.
After removing the variable from a fact, the corresponding row in the source looks like this: 
  when  
          : fact(/*whatever was matched here*/)
  then
The colon after the variable is still there, even if there's no variable now (except for the empty string and that shouldn't count). If it was on the first line, you can still validate the rule and it will be ok. More problems show, when you do the same thing to a fact on another line or when you remove a binding form a field. Validation then returns an error message containing something like: 
  [<rule>] [ERR 102] Line x:y mismatched input ':' in rule "<rule>"
  [<rule>] Parser returned a null Package


Version-Release number of selected component (if applicable):
BRMS 5.2.0 ER5


Steps to Reproduce:
1. Add a Fact to a rule,
2. add another fact, add a field to it.
3. Bind a) a valid variable or b) an empty string variable to the 2nd fact and another to its field.
4a. Rewrite the binding with an empty string for the a) second fact or b) its field.

Validate.

  
Actual results:
Error message
  [<rule>] [ERR 102] Line x:y mismatched input ':' in rule "<rule>"
  [<rule>] Parser returned a null Package


Expected results:
Rule validated ok.


Additional info:
It should be enough to just test the variable string for an empty string before setting anything and removing the variable and the colon when it is empty.

Comment 1 Zuzana Krejčová 2011-10-10 12:02:48 UTC
Created attachment 527224 [details]
removed field variable, viewing source

Comment 2 Zuzana Krejčová 2011-10-10 12:03:33 UTC
Created attachment 527225 [details]
validatind after removing field variable

Comment 3 Zuzana Krejčová 2011-10-10 12:04:41 UTC
Created attachment 527226 [details]
validation after removing fact variable for first condition in the rule

Comment 4 manstis 2011-11-08 21:13:53 UTC
Followed the prescribed steps to reproduce and was unable with the current code-base for 5.3.x. Looking at the commit history it appears to have been fixed as a side-effect of JIRA "GUVNOR-1553: Guided Rule Editor: Cannot set enum attribute with a formula expression in guided editor"


Note You need to log in before you can comment on or make changes to this bug.