Bug 1052269 - Guided rule editor: rule with incomplete String constraint reopens with different definition and elements missing
Summary: Guided rule editor: rule with incomplete String constraint reopens with diffe...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER1
: 6.0.2
Assignee: Toni Rikkola
QA Contact: Zuzana Krejčová
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-13 14:40 UTC by Zuzana Krejčová
Modified: 2016-08-01 01:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Fixed Issue Summary: While creating a rule in the GRE, if you left a constraint element on a String field incomplete, saved and reopened, the definition for the element would change and all conditional elements that were below it would disappear. That is, saving an incomplete Guided Rule Element would result in a different rule definition and parts of the rule would be missing when the rule was reopened. This has been fixed by validation that prevents the user from saving rules that do not open. Cause: An incomplete constraint on a String attribute of a Data Object to a Guided Rule is not handled correctly upon saving. Consequence: Leaving a constraint element on a String attribute incomplete causes the definition for this element to change and all conditions elements below it to disappear after saving and reopening the rule. Workaround (if any): Do not save a Guided Rule with incomplete constraints. Result: Saving an incomplete Guided Rule may result in a different rule definition and parts of the rule missing, when the rule is reopened.
Clone Of:
Environment:
Last Closed: 2014-08-06 19:53:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
guided rule before reopening (36.80 KB, image/png)
2014-01-13 14:40 UTC, Zuzana Krejčová
no flags Details
guided rule after reopening (25.96 KB, image/png)
2014-01-13 14:44 UTC, Zuzana Krejčová
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1009385 0 medium CLOSED Invalid Guided Rule reopens with a different definition 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1023126 0 unspecified CLOSED Saving Guided Rule with uninitialized field values causes errors after reopening 2021-02-22 00:41:40 UTC

Internal Links: 1009385 1023126

Description Zuzana Krejčová 2014-01-13 14:40:55 UTC
Created attachment 849413 [details]
guided rule before reopening

Description of problem:
If you leave a constraint element on a String field incomplete, save and reopen, the definition for this element will change and all conditions elements that were below it will disappear.


Version-Release number of selected component (if applicable):
BPMS 6.0 ER7


Steps to Reproduce:
With data model including StringFact POJO with attribute field of type String:
1. Open or create a new guided rule.
2. Add some valid condition elements:
     There is a Fact1 with: field1 equal to 1
     There is a Fact2 with: field2 equal to "some text"
3. Add StringFact, click it to add a constraint on field.
4. Select an operator (e.g. equal to).
5. Add a few more valid condition elements, similar to step 2.
6. Save, close and reopen the rule.


Actual results:
Condition elements from step 2 are present, elements from step 4 are not. Condition added in step 3 has changed to "Any of the following are true: There is a StringFact".


Expected results:
Condition elements both from step 2 and step 4 are present. Element from step 3 does not contain the incomplete constraint, but is otherwise unchanged (the same behaviour as with other types).


Additional info:
The issue seems to be with String fields only, e.g. Integer fields were ok.
If you don't select an operator, the (unfinished) constraint won't get into the rule source and rule reopens as it should (only the incomplete constraint is missing, as per bug 1023126 comment 5).

Comment 1 Zuzana Krejčová 2014-01-13 14:44:18 UTC
Created attachment 849418 [details]
guided rule after reopening

What these screenshots don't show is that (contrary to what was reported in bug 1023126), the RHS stays the same after reopening.

Also, the source tab shows "StringFact( field == )" for the incomplete condition/constraint (before reopening).

Comment 2 Edson Tirelli 2014-01-15 01:13:38 UTC
I am not sure this can be fixed on the back end. Finding an unmatched quote our double-quote will make the lexer go nuts. Is there a way to force the UI to not allow unmatched quotes?

Comment 3 Toni Rikkola 2014-01-15 08:58:16 UTC
We can add validation for this in the UI.

Comment 6 Toni Rikkola 2014-03-10 11:17:23 UTC
The rule will still fail to open, but the validation should prevent the user from saving rules that do not open.

Comment 7 Zuzana Krejčová 2014-04-29 15:38:57 UTC
Verified with ER2 - it is no longer possible to save such a rule.


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