Bug 1012553 - GRE doesn't handle multirestrictions when reopening rule
GRE doesn't handle multirestrictions when reopening rule
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.0.0
Unspecified Unspecified
medium Severity medium
: ER1
: 6.0.2
Assigned To: Toni Rikkola
Jiri Locker
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-26 11:55 EDT by Jiri Locker
Modified: 2014-08-06 15:53 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
Fixed Issue Summary: While saving a guided rule with multiple restrictions on a single fact field, users were unable to reopen the rule and were presented with an error message. This issue has been fixed by removing the "more options" button to a field, and now it is not possible to create multiple restrictions using the joint operators (&& !=, || <, etc.). Cause: Saving a Guided Rule with multiple restrictions on a single fact field. Consequence: It is not possible to reopen the rule. The user is presented with an error message. Workaround (if any): None. Result:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-06 15:53:06 EDT
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)

  None (edit)
Description Jiri Locker 2013-09-26 11:55:25 EDT
Description of problem:
Basically the same problem as bug 975922 and bug 1000464 but affecting multirestrictions.

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

How reproducible:
-

Steps to Reproduce:
1. create fact pattern similar to Person( age == 10 || > 20 )
2. reopen the rule


Actual results:
Operator select box is reset.

Expected results:
GRE should reopen the rule as it was saved.

Additional info:
Affects all kinds of operators (==, <, <==, etc.), contains, excludes, matches soundslike, ...
Comment 1 Edson Tirelli 2013-10-01 09:44:44 EDT
The restriction syntax is deprecated and we definitively don't want to support that in the UI. 

If we are having problems importing existing DRLs that use that syntax, we can use the expression rewrite we have in core to properly convert the deprecated syntax into the extended syntax.

I don't remember if in 5 we supported such syntax, but if we did, it would be good to consider disabling it in 6. This restriction syntax causes clashes with free form expressions that are much more flexible and the best syntax forward.
Comment 2 manstis 2013-10-24 11:00:07 EDT
Edson, "If we are having problems importing existing DRLs that use that syntax, we can use the expression rewrite we have in core to properly convert the deprecated syntax into the extended syntax." Could you please point me to what/where this is? Thanks, Mike
Comment 3 Toni Rikkola 2013-12-03 03:25:34 EST
Can't reproduce anymore. I could yesterday.

Must have been fixed as a side effect for some other change. Unfortunately I can't figure out what.
Comment 4 Toni Rikkola 2013-12-03 03:36:35 EST
More details.

The editor no longer saves rules like this:
Person( age == 10 || > 20 )

It does this:
Person( age == 10 || age == > 20 )
Comment 5 Jiri Locker 2014-01-15 03:38:53 EST
(In reply to Toni Rikkola from comment #4)
> More details.
> 
> The editor no longer saves rules like this:
> Person( age == 10 || > 20 )
> 
> It does this:
> Person( age == 10 || age == > 20 )

Not true for ER7. The rule is still saved as:
Applicant( name == "a"  || == "b" )

Moreover, such rule now cannot be reopened at all. I get an error dialog with message "Unable to complete your request. The following exception occurred: null.". No stack trace in server log.
Comment 6 Toni Rikkola 2014-03-10 09:12:37 EDT
Ok. I found the button next to the constraint that still allowed me to do Person( age == 10 || > 20 ).

I removed the button. Since if the button is used and the rule is saved and reopened the rule will open looking different. The constraints are split into their own lines.
Looking like this:
Person( 
  age == 10 
|| 
  age > 20 )

master:
https://github.com/droolsjbpm/drools-wb/commit/c3fc6286f
6.0.x:
https://github.com/droolsjbpm/drools-wb/commit/4ad8f1b92
Comment 7 Jiri Locker 2014-05-06 10:23:41 EDT
The button allowing to add "more options" to a field was removed and now it is not possible to create multirestrictions using the joint operators (&& !=, || <, etc.).

However rules using this syntax may have been created in product versions 6.0.0 and 6.0.1 or imported from 5.x repositories. These rules will be still displayed incorrectly when open in Guided Rule editor. Optimal solution would be to automatically convert this syntax to the new replacement when the rule is opened...

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