Bug 814514 - Rules from Guided Editor is disabled when used "From Collect" CE
Rules from Guided Editor is disabled when used "From Collect" CE
Status: VERIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRM (Guvnor) (Show other bugs)
BRMS 5.3.0.GA
Unspecified Unspecified
medium Severity unspecified
: ER8
: BRMS 5.3.0.GA
Assigned To: Alexandre Porcelli
Sona Mala
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-19 23:42 EDT by Alessandro Lazarotti
Modified: 2012-05-30 21:48 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When using the BRMS guided editor to create rules with 'From collect' the rule would be disabled, this was because it was necessary to import java.uti.List. This has been resolved and the import is now automatically added allowing the user to create and modify the rules.
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)
Screenshot (111.63 KB, image/png)
2012-04-19 23:45 EDT, Alessandro Lazarotti
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GUVNOR-1871 Major Resolved Rules from Guided Editor is disabled when used "From Collect" CE 2013-04-16 05:04:19 EDT

  None (edit)
Description Alessandro Lazarotti 2012-04-19 23:42:26 EDT
Rules from Guided Editor is disabled when used "From Collect" CE

When "from collect" is used the rule becomes disabled, showing a gray area around it.
To reproduce:

1) Create a new rule by Guided Editor
2) Add a "From Collect..." statement
3) Click on the first "(click to add patterns...)" and select some collection

Now this part of the rule is disabled (look the gray area). You can not edit or delete this part.
Comment 1 Alessandro Lazarotti 2012-04-19 23:45:08 EDT
Created attachment 578853 [details]
Screenshot
Comment 2 JBoss JIRA Server 2012-04-20 12:57:28 EDT
Michael Anstis <michael.anstis@gmail.com> made a comment on jira GUVNOR-1871

Have you imported java.util.List into the package definition?
Comment 3 JBoss JIRA Server 2012-04-20 13:01:25 EDT
Michael Anstis <michael.anstis@gmail.com> made a comment on jira GUVNOR-1871

Alexandre, feel free to assign this (and the Bugzilla) to me - unless this is something you 1) want to look at, or 2) is something that needs fixing today (20th) for BRMS 5.3?
Comment 4 JBoss JIRA Server 2012-04-20 13:06:00 EDT
Alexandre Porcelli <alexandre.porcelli@gmail.com> made a comment on jira GUVNOR-1871

Don't worry Mike - I've been supporting Alessandro to reproduce it - so I can work on that with no problem (and i can learn something outside what i've been working).
Comment 5 JBoss JIRA Server 2012-04-20 13:22:22 EDT
Michael Anstis <michael.anstis@gmail.com> made a comment on jira GUVNOR-1871

Ok, no problem. It is probably the missing import...;)
Comment 6 JBoss JIRA Server 2012-04-20 14:46:39 EDT
Alessandro Lazarotti <alazarot@redhat.com> made a comment on jira GUVNOR-1871

Hi mantis,
Actually add an import to java.uti.List (or another collection) works, I've just re-tested.
However it is a workaround, since this should not be necessary. The generated code from the Guided Editor is:
something like:

1.	|	rule "rule1"
2.	|	    dialect "mvel"
3.	|	    when
4.	|	        java.util.List( ) from collect ( )
5.	|	    then
6.	|	end

The collection uses a full qualified name, so should not be necessary to add an import statement
Comment 7 Alessandro Lazarotti 2012-04-20 15:16:47 EDT
As a reasonable workaround can be used (look technical notes), GSS is prioritizing this ticket as "medium" level.
Comment 8 Alessandro Lazarotti 2012-04-20 15:16:48 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Workaround:
  Declaring the collection in imported types:
  1) in the package view, click on Edit tab
  2) in "Configuration:imported types", click on the plus icon
  3) put the full qualified name of the collection in the filed "(advanced) class name" and ok
  4) File > Save changes
Comment 9 JBoss JIRA Server 2012-04-20 17:54:58 EDT
Michael Anstis <michael.anstis@gmail.com> made a comment on jira GUVNOR-1871

It might be best to ensure java.util.List is added as an import when a rule defined with the Guided Rule Editor has a collect (or accumulate). Even better to check, if the import is removed and any rule needs it to ti e a warning (this could equally apply if any import is removed that is needed). Note: the Guided Decision Table editor also allows columns to be defined that use "from collect" etc so an import will be needed for these too. Rule Templates also have the same requirement but use the same editor as the Guided Rule Editor so should not need special consideration.
Comment 10 JBoss JIRA Server 2012-04-24 08:39:44 EDT
Michael Anstis <michael.anstis@gmail.com> made a comment on jira GUVNOR-1871

This is also related: https://bugzilla.redhat.com/show_bug.cgi?id=760502
Comment 11 JBoss JIRA Server 2012-04-25 16:09:00 EDT
Alexandre Porcelli <alexandre.porcelli@gmail.com> made a comment on jira GUVNOR-1871

Bug fixed on master - https://github.com/droolsjbpm/guvnor/commit/8cbc88e9326690e62e175e91ca5c770d514aaab7
Comment 12 JBoss JIRA Server 2012-04-25 16:13:30 EDT
Alexandre Porcelli <alexandre.porcelli@gmail.com> updated the status of jira GUVNOR-1871 to Resolved
Comment 13 Alexandre Porcelli 2012-04-25 16:33:17 EDT
bug fixed on master and 5.4.x branches.
Comment 14 Ryan Zhang 2012-05-10 21:54:35 EDT
Yes, as Alexandre pointed out, it is not in 5.3.x branch, so it wounldn't be picked by BRMS 5.3. 

As it 's not in block+ and 5.3.0+ flag, assign it to Anne to decide where it should go.
cc Lukas as QE expect it by set qa_ack+.
Comment 15 Lukáš Petrovický 2012-05-11 07:45:45 EDT
Requesting blocker, otherwise it's not going to land in 5.3 anyway.
Comment 16 Ryan Zhang 2012-05-11 08:32:52 EDT
Assign back to Alessandro.

Please back port this to 5.3.x branch.
Comment 17 Alexandre Porcelli 2012-05-11 09:27:47 EDT
done, back ported to 5.3.x branch
Comment 18 Ryan Zhang 2012-05-14 04:16:23 EDT
The fixed for this issue should be included in ER7. Please do verification on it.
Comment 20 Sona Mala 2012-05-23 11:01:05 EDT
Please, can you tell me what should be exected behaviour of this issue?
There is no warnings that I need import java.util.Collection into package.

In Business Rule - Guided Editor:
I can observe same behaviour as was described in comment #1 and is displayed on attached image.

In Decision Table - Web Guided Editor:
They put import automaticaly.
Comment 21 Alessandro Lazarotti 2012-05-23 14:56:39 EDT
You are right Sona,
I've tested using ER7 and the issue is still there.
Comment 22 Lukáš Petrovický 2012-05-24 02:12:29 EDT
(In reply to comment #21)
> You are right Sona,
> I've tested using ER7 and the issue is still there.

Re-opening.
Comment 23 Alexandre Porcelli 2012-05-25 10:03:19 EDT
Just double checked on 5.3.x branch and it does work. Probably my commit is missing on product branch, here is the commit sha1 that fixes this issue: d13fa24683ef0be89fa40f20392892c8c78c59d6
Comment 24 Ryan Zhang 2012-05-27 22:29:07 EDT
Yes, it's my mistake.
The ER7's upstream code cutting date is May 10, and ER7's announce date is May 14.
So this issue happens to be committed in May 11 which I didn't notice that.

Any way I have comfirmed this has been picked up by ER8.
I updated the status to ON_QA and Milestone to ER8
Comment 25 Sona Mala 2012-05-28 09:18:29 EDT
Verified for ER8. I do not need import any more and "From Collect" section is enable to modify.
Comment 26 lcarlon 2012-05-30 21:47:28 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,6 +1 @@
-Workaround:
+When using the BRMS guided editor to create rules with 'From collect' the rule would be disabled, this was because it was necessary to import java.uti.List. This has been resolved and the import is now automatically added allowing the user to create the rules.-  Declaring the collection in imported types:
-  1) in the package view, click on Edit tab
-  2) in "Configuration:imported types", click on the plus icon
-  3) put the full qualified name of the collection in the filed "(advanced) class name" and ok
-  4) File > Save changes
Comment 27 lcarlon 2012-05-30 21:47:55 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-When using the BRMS guided editor to create rules with 'From collect' the rule would be disabled, this was because it was necessary to import java.uti.List. This has been resolved and the import is now automatically added allowing the user to create the rules.+When using the BRMS guided editor to create rules with 'From collect' the rule would be disabled, this was because it was necessary to import java.uti.List. This has been resolved and the import is now automatically added allowing the user to create and modify the rules.

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