Bug 986000 - DRL-to-RuleModel marshalling improvements
Summary: DRL-to-RuleModel marshalling improvements
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ER1
: 6.0.1
Assignee: Toni Rikkola
QA Contact: Zuzana Krejčová
URL:
Whiteboard:
Depends On: 970203 1073379
Blocks: 1069273
TreeView+ depends on / blocked
 
Reported: 2013-07-18 17:47 UTC by Luan Cestari
Modified: 2018-12-02 17:10 UTC (History)
9 users (show)

Fixed In Version:
Clone Of: 970203
: 1069273 (view as bug list)
Environment:
Last Closed: 2014-08-06 19:58:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1013682 0 high CLOSED GRE doesn't recognize formulas, calls on globals, etc. when reopening rule 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1045423 0 high CLOSED Guided Rule Editor: Add support for using formulas\expressions in ActionCallMethodWidget 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1047879 0 unspecified CLOSED GRE regression in handling nested enum values 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker GUVNOR-2026 0 Major Resolved Unable to use some options for int sub-fields in Guvnor 2015-06-15 06:51:17 UTC

Internal Links: 1013682 1045423 1047879

Comment 5 manstis 2013-09-06 12:59:28 UTC
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 09:09:46 UTC
Toni, reassigned to you as you're handling it at the moment. Thanks.

Comment 13 Jiri Locker 2013-10-31 13:01:15 UTC
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 11:13:39 UTC
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 08:32:04 UTC
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 11:32:02 UTC
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 18:18:38 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/111383c7a
Reassigning to Toni.

Comment 20 Edson Tirelli 2014-01-02 16:29:49 UTC
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 12:19:45 UTC
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 14:33:16 UTC
(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 12:53:37 UTC
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 12:15:57 UTC
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 12:34:28 UTC
Test in master:
https://github.com/droolsjbpm/drools/commit/5dcf4be70

Comment 26 Mario Fusco 2014-01-30 14:42:59 UTC
Toni is working on this. Reassigning the ticket to him

Comment 28 JBoss JIRA Server 2014-03-18 10:28:41 UTC
Michael Anstis <michael.anstis> 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.