Bug 1009385 - Invalid Guided Rule reopens with a different definition
Invalid Guided Rule reopens with a different definition
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.0.0
Unspecified Unspecified
medium Severity medium
: ER3
: 6.1.0
Assigned To: Toni Rikkola
Lukáš Petrovický
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-18 06:34 EDT by Zuzana Krejčová
Modified: 2016-07-31 21:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If you close and save the Guided Rule Editor with an unfinished or invalid change, you will not be able to work on the incomplete rule when you reopen it because the Guided Rule Editor opens the rule with a different definition. Cause: Consequence: Fix: Result:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
DR3 - broken editor (15.81 KB, image/png)
2014-09-29 04:46 EDT, Zuzana Krejčová
no flags Details
DR3 - displayed source (22.82 KB, image/png)
2014-09-29 04:46 EDT, Zuzana Krejčová
no flags Details

  None (edit)
Description Zuzana Krejčová 2013-09-18 06:34:04 EDT
Description of problem:
Some unfinished or invalid changes cause the Guided Rule to reopen with a different definition.
It would be unwise to assume users will always save correct rules, therefore this should be fixed. The rule should stay the same after reopening as it was before being closed.


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


Steps to Reproduce:
1. Create a new Guided Rule.
2. Add "The following does not exist .." to the WHEN section.
3. Save, close, reopen.


Actual results:
"Any of the following are true:
	There is a then" in the Guided Editor, 
"rule "grl"
    dialect "mvel"
    when
        ( then( ) )
    then
 end"
in the source.


Expected results:
"The following does not exist (click to add patterns...):" in the Guided Editor,
"rule "grl"
    dialect "mvel"
    when
        not    then
 end"
in the source.


Additional info:
Comment 6 Toni Rikkola 2013-11-29 05:41:08 EST
Unit tests for this.

https://github.com/droolsjbpm/drools/commit/52a7b1730
Comment 7 Mario Fusco 2013-12-02 03:46:40 EST
Trying to unmarshall an invalid drl is more or less like trying to unmarshall a malformed xml. I could fix the provided test cases, but for sure it will be impossible to do the same for all the possible combination that an invalid drl could generate. For this reason Toni and myself agreed to save a drl, and then attempt its unmarshall when necessary, only if it compiles.
Comment 8 Toni Rikkola 2013-12-09 08:00:00 EST
The current fix prevents the user from saving incomplete rules on "exists", "or" or "not" sections, asking the user to complete the areas marked in red (The missing fact types are red in the editor).

master: https://github.com/droolsjbpm/drools-wb/commit/79283ebab

6.0.x: https://github.com/droolsjbpm/drools-wb/commit/fc38da234
Comment 9 Zuzana Krejčová 2014-01-13 08:37:22 EST
(In reply to Toni Rikkola from comment #8)
> The current fix prevents the user from saving incomplete rules on "exists",
> "or" or "not" sections, asking the user to complete the areas marked in red
> (The missing fact types are red in the editor).
> 
> master: https://github.com/droolsjbpm/drools-wb/commit/79283ebab
> 
> 6.0.x: https://github.com/droolsjbpm/drools-wb/commit/fc38da234

Sorry for not getting back to you earlier.

The above mentioned sections work as you say.

Could the same be done for "From [... | Accumulate | Collect | Entry point]" sections? If you don't finish these, the incomplete parts are also marked in red, but the rule can be saved anyway and the same thing happens that happened with "exists" before you fixed it.
Comment 10 Toni Rikkola 2014-01-14 06:39:46 EST
It can and should be done.
Comment 11 Toni Rikkola 2014-03-10 07:54:46 EDT
The commits for https://bugzilla.redhat.com/show_bug.cgi?id=1012553 improve model validation when saving and actually cover the from/accumulate/collect and entry point.
Comment 12 Toni Rikkola 2014-03-10 07:56:11 EDT
(In reply to Toni Rikkola from comment #11)
> The commits for https://bugzilla.redhat.com/show_bug.cgi?id=1012553 improve
> model validation when saving and actually cover the from/accumulate/collect
> and entry point.

Wrong link. Should be https://bugzilla.redhat.com/show_bug.cgi?id=1052269
Comment 13 Zuzana Krejčová 2014-05-22 10:30:03 EDT
"From Collect ..." is still an issue. The rests is fixed in ER2.
Comment 15 Edson Tirelli 2014-06-17 08:51:15 EDT
Adjusting the flags as the last commit from this ticket did not make 6.0.2.CR1 cut.
Comment 16 Zuzana Krejčová 2014-09-29 04:45:30 EDT
"From Collect ..." now cannot even be added to the rule without totally corrupting it. Everything below that condition simply disappears - from the editor and also from the displayed source.
The fix is at least partially working as trying to save the rule results in the expected warning.
(working with DR3)
Comment 17 Zuzana Krejčová 2014-09-29 04:46:05 EDT
Created attachment 942235 [details]
DR3 - broken editor
Comment 18 Zuzana Krejčová 2014-09-29 04:46:36 EDT
Created attachment 942236 [details]
DR3 - displayed source
Comment 19 Toni Rikkola 2014-11-20 08:49:02 EST
(In reply to Zuzana Krejčová from comment #16)
> "From Collect ..." now cannot even be added to the rule without totally
> corrupting it. Everything below that condition simply disappears - from the
> editor and also from the displayed source.
> The fix is at least partially working as trying to save the rule results in
> the expected warning.
> (working with DR3)

Fixes for this. Now it should prevent the save if any red is shown.

master:
https://github.com/droolsjbpm/drools-wb/commit/0e82448ef

6.2.x:
https://github.com/droolsjbpm/drools-wb/commit/763d4f720

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