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.
DescriptionZuzana 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).
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).
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?