Bug 814514

Summary: Rules from Guided Editor is disabled when used "From Collect" CE
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: BRM (Guvnor)Assignee: manstis
Status: VERIFIED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: medium    
Version: BRMS 5.3.0.GACC: rzhang
Target Milestone: ER8   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot none

Description Alessandro Lazarotti 2012-04-20 03:42:26 UTC
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-20 03:45:08 UTC
Created attachment 578853 [details]
Screenshot

Comment 2 JBoss JIRA Server 2012-04-20 16:57:28 UTC
Michael Anstis <michael.anstis> 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 17:01:25 UTC
Michael Anstis <michael.anstis> 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 17:06:00 UTC
Alexandre Porcelli <alexandre.porcelli> 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 17:22:22 UTC
Michael Anstis <michael.anstis> made a comment on jira GUVNOR-1871

Ok, no problem. It is probably the missing import...;)

Comment 6 JBoss JIRA Server 2012-04-20 18:46:39 UTC
Alessandro Lazarotti <alazarot> 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 19:16:47 UTC
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 19:16:48 UTC
    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 21:54:58 UTC
Michael Anstis <michael.anstis> 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 12:39:44 UTC
Michael Anstis <michael.anstis> 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 20:09:00 UTC
Alexandre Porcelli <alexandre.porcelli> 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 20:13:30 UTC
Alexandre Porcelli <alexandre.porcelli> updated the status of jira GUVNOR-1871 to Resolved

Comment 13 Alexandre Porcelli 2012-04-25 20:33:17 UTC
bug fixed on master and 5.4.x branches.

Comment 14 Ryan Zhang 2012-05-11 01:54:35 UTC
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 11:45:45 UTC
Requesting blocker, otherwise it's not going to land in 5.3 anyway.

Comment 16 Ryan Zhang 2012-05-11 12:32:52 UTC
Assign back to Alessandro.

Please back port this to 5.3.x branch.

Comment 17 Alexandre Porcelli 2012-05-11 13:27:47 UTC
done, back ported to 5.3.x branch

Comment 18 Ryan Zhang 2012-05-14 08:16:23 UTC
The fixed for this issue should be included in ER7. Please do verification on it.

Comment 20 Sona Mala 2012-05-23 15:01:05 UTC
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 18:56:39 UTC
You are right Sona,
I've tested using ER7 and the issue is still there.

Comment 22 Lukáš Petrovický 2012-05-24 06:12:29 UTC
(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 14:03:19 UTC
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-28 02:29:07 UTC
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 13:18:29 UTC
Verified for ER8. I do not need import any more and "From Collect" section is enable to modify.

Comment 26 lcarlon 2012-05-31 01:47:28 UTC
    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-31 01:47:55 UTC
    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.