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).
Toni, reassigned to you as you're handling it at the moment. Thanks.
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.
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'.
Test for Customer( c : contact != null ) Customer( contact == c , contact.tel1 > 15 ) https://github.com/droolsjbpm/drools/commit/0f34189ba
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.
Fixed by https://github.com/droolsjbpm/drools/commit/111383c7a Reassigning to Toni.
This fixes are required by and related to the other DRL/RuleModel marshalling errors that have been raised.
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.
(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.
The "Customer( contact != null , contact.tel1 > 15 )" case mentioned in comment 16 (and comment 18) is still broken.
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.
Test in master: https://github.com/droolsjbpm/drools/commit/5dcf4be70
Toni is working on this. Reassigning the ticket to him
Fix for master: https://github.com/droolsjbpm/drools/commit/887139648 Fix and test for 6.0.x: https://github.com/droolsjbpm/drools/compare/b0a39b7...9e2089d
Michael Anstis <michael.anstis> updated the status of jira GUVNOR-2026 to Resolved