This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 986000 - DRL-to-RuleModel marshalling improvements
DRL-to-RuleModel marshalling improvements
Status: CLOSED CURRENTRELEASE
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.0.0
Unspecified Unspecified
high Severity low
: ER1
: 6.0.1
Assigned To: Toni Rikkola
Zuzana Krejčová
:
Depends On: 970203 1073379
Blocks: 1069273
  Show dependency treegraph
 
Reported: 2013-07-18 13:47 EDT by Luan Cestari
Modified: 2015-06-14 19:05 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 970203
: 1069273 (view as bug list)
Environment:
Last Closed: 2014-08-06 15:58:39 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GUVNOR-2026 Major Resolved Unable to use some options for int sub-fields in Guvnor 2015-06-15 02:51:17 EDT

  None (edit)
Comment 5 manstis 2013-09-06 08:59:28 EDT
Renamed BZ as investigations into the specific problem reported highlights the need to generally improve the DRL-to-RuleModel (class used by the Guided Rule Editor) marshalling. The specific problem reported here was true (although for a different reason in 6.x vs 5.x).
Comment 8 manstis 2013-09-16 05:09:46 EDT
Toni, reassigned to you as you're handling it at the moment. Thanks.
Comment 13 Jiri Locker 2013-10-31 09:01:15 EDT
I have built a rule containing Person( contact != null , contact.tel1 > 0 ). When I close it and reopen I get "Unable to complete your request. The following exception occurred: null.". The rule content is not loaded into guided editor.
Comment 16 Zuzana Krejčová 2013-12-19 06:13:39 EST
There seems to be a problem with the 'is not null' operator and equalling fields to previously defined variables. See below.


When I build, save and reopen a rule, similar to the one in comment 13, instead of the original, valid 
    Customer( contact != null , contact.tel1 > 15 )
I get 
    Customer( contact != null , contact.contact.tel1 > 15 )
which is, of course, invalid. The 'contact.contact.tel1 > 15 ' section is now done in the Expression Editor (and looks ok in the guided editor). The rule was done by these steps:
1. Add the Customer fact, click it, add constraint on field contact.
2. Choose 'is not null' operator for field contact.
3. Click the field contact, click 'show sub fields', choose tel1.
4. Choose 'greater than' operator for field tel1 and literal value, type in 15.

Removing 'contact != null' results in a valid rule.

The 'is null' operator doesn't cause the same issue.

Creating the rule using the Expression Editor from the start and without 'contact != null' makes it valid even after reopening. Including 'contact != null' creates the same problem.

Putting 'contact != null' after the sub-field expression is ok.

A rule with:
    Customer( c : contact != null )
    Customer( contact == c , contact.tel1 > 15 )
all done without the Expression Editor reopens to a valid rule with the same source, though done using the Expression Editor. The source shows the section 'contact == c', but in the guided editor it looks as if the variable was not chosen and the list box only offers 'Choose...'. After removing the list box for bound variables, I cannot get to it again - I can only add the variable by choosing either literal value, new formula, expression editor (where the 'c' variable is available again though). Fixing it in the guided editor with the expression editor, saving and reopening gets me to the same state/problem of course.
Same happens for 'contact != c'.
Comment 17 Toni Rikkola 2013-12-20 03:32:04 EST
Test for 
    Customer( c : contact != null )
    Customer( contact == c , contact.tel1 > 15 )

https://github.com/droolsjbpm/drools/commit/0f34189ba
Comment 18 Toni Rikkola 2013-12-20 06:32:02 EST
Test for 
    Customer( contact != null , contact.tel1 > 15 )

https://github.com/droolsjbpm/drools/commit/decbe02e1

The cause for this might actually be in the client side. So fixing the unit test might not be enough.
Comment 19 Mario Fusco 2013-12-20 13:18:38 EST
Fixed by https://github.com/droolsjbpm/drools/commit/111383c7a
Reassigning to Toni.
Comment 20 Edson Tirelli 2014-01-02 11:29:49 EST
This fixes are required by and related to the other DRL/RuleModel marshalling errors that have been raised.
Comment 21 Toni Rikkola 2014-01-07 07:19:45 EST
Customer( c : contact != null )
Customer( contact == c , contact.tel1 > 15 )

The editor failed to figure out the type for "c" so the value was left empty for the contact == in the second line.
Comment 22 Toni Rikkola 2014-01-20 09:33:16 EST
(In reply to Toni Rikkola from comment #21)
> Customer( c : contact != null )
> Customer( contact == c , contact.tel1 > 15 )
> 
> The editor failed to figure out the type for "c" so the value was left empty
> for the contact == in the second line.

Commit for this was 
master: https://github.com/droolsjbpm/drools-wb/commit/82997a580613cb53fc4e89fdf0120ad347cab244
6.0.x: https://github.com/droolsjbpm/drools-wb/commit/2d11e958a39367369b6ab125d91d862d68838943

The commit message is wrong. Should be for this ticket.
Comment 23 Zuzana Krejčová 2014-01-27 07:53:37 EST
The "Customer( contact != null , contact.tel1 > 15 )" case mentioned in comment 16 (and comment 18) is still broken.
Comment 24 Toni Rikkola 2014-01-29 07:15:57 EST
The 
Customer( contact != null , contact.tel1 > 15 )
can not be opened if it was created with field's "Show subfields..." option. The subfields option saves an invalid pattern:
Customer( contact != null ,, contact.tel1 > 15 )

If the same is created with the "Expression editor" then the rule is saved correctly.

Fixing the subfields-issue.
Comment 25 Toni Rikkola 2014-01-29 07:34:28 EST
Test in master:
https://github.com/droolsjbpm/drools/commit/5dcf4be70
Comment 26 Mario Fusco 2014-01-30 09:42:59 EST
Toni is working on this. Reassigning the ticket to him
Comment 28 JBoss JIRA Server 2014-03-18 06:28:41 EDT
Michael Anstis <michael.anstis@gmail.com> updated the status of jira GUVNOR-2026 to Resolved

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