Bug 1289758 - Missing data model objects in editors (package white list default too constricting)
Missing data model objects in editors (package white list default too constri...
Status: ASSIGNED
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: manstis
Lukáš Petrovický
: Reopened
: 1289765 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-08 16:38 EST by Eric D. Schabell
Modified: 2016-07-31 21:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-09 04:11:06 EST
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)
No default package selection possible (27.42 KB, image/png)
2015-12-08 16:38 EST, Eric D. Schabell
no flags Details
Guided rule not showing data objects (91.78 KB, image/png)
2015-12-08 16:39 EST, Eric D. Schabell
no flags Details
Guided rule WHEN not showing data objects (106.10 KB, image/png)
2015-12-08 16:39 EST, Eric D. Schabell
no flags Details
DRL not showing data objects (16.14 KB, image/png)
2015-12-08 16:40 EST, Eric D. Schabell
no flags Details

  None (edit)
Description Eric D. Schabell 2015-12-08 16:38:55 EST
Created attachment 1103728 [details]
No default package selection possible

Description of problem: 
Install bpms-install-demo project for bpm suite 6.2.0.GA, start server, login, follow steps from workshop starting:

http://bpmworkshop-onthe.rhcloud.com/brms6_1/lab02.html#/3

Note screenshots are from 6.1 product, but create unmanaged project and follow along until you hit:

http://bpmworkshop-onthe.rhcloud.com/brms6_1/lab03.html#/3

Now create data object:

 - Product with id attribute at package level com.redhat.coolstore no persistence checked and save.

First issue, notice (see screenshot attached), can't select Default package level, just com, com.redhat or com.redhat.coolstore. 

Now create data object:

 - ShoppingCart with id attribute at package level com.redhat no persistence checked and save.

Now create guided rule:

 - TestRule at package level Default (note you have Default package level now) no DSL
 - select Config tab, Add Import button, pull down shows only Product object, Integer and Number, see attached screenshot.

Second issue, should show all data objects.

Now back to guided rule Editor tab, click on WHEN plus icon, only see Number, see attached screenshot.

Third issue, don't expect any data objects, but why only Number available for use in rule, hard to build a rule. 

Same for DRL, Forms, Guided Decision Table, Guided Decision Tree, etc. All that allow for import of data objects fails to find in project.

All encountered using this workshop: http://bpmworkshop-onthe.rhcloud.com/brms6_1/lab01.html but with BPM Suite 6.2.0.GA to test product.

Version-Release number of selected component (if applicable): 6.2.0.GA


How reproducible: see above.


Steps to Reproduce:
1. see above
2.
3.

Actual results: no data objects available for import when in project.


Expected results: data objects in project available for import.


Additional info:
attached screenshots.
Comment 1 Eric D. Schabell 2015-12-08 16:39 EST
Created attachment 1103730 [details]
Guided rule not showing data objects
Comment 2 Eric D. Schabell 2015-12-08 16:39 EST
Created attachment 1103731 [details]
Guided rule WHEN not showing data objects
Comment 4 Eric D. Schabell 2015-12-08 16:40 EST
Created attachment 1103732 [details]
DRL not showing data objects
Comment 5 Zuzana Krejčová 2015-12-09 03:53:01 EST
*** Bug 1289765 has been marked as a duplicate of this bug. ***
Comment 6 Zuzana Krejčová 2015-12-09 04:04:19 EST
(In reply to Eric D. Schabell from comment #0)
> 
> First issue, notice (see screenshot attached), can't select Default package
> level, just com, com.redhat or com.redhat.coolstore. 

That is by design.


>  - TestRule at package level Default (note you have Default package level
> now) no DSL
>  - select Config tab, Add Import button, pull down shows only Product
> object, Integer and Number, see attached screenshot.
> 
> Second issue, should show all data objects.

Here, you actually hit an issue/feature. See bug 1256335 and bug 1155371 comment 9.


> Now back to guided rule Editor tab, click on WHEN plus icon, only see
> Number, see attached screenshot.
> 
> Third issue, don't expect any data objects, but why only Number available
> for use in rule, hard to build a rule. 

This, I don't understand either, but since your issue is with missing data objects here, perhaps you could create a new ticket for that, if it really is a problem.
Comment 7 Zuzana Krejčová 2015-12-09 04:06:32 EST
As for the default package for data objects, please see this: bug 1029556.
Comment 8 Zuzana Krejčová 2015-12-09 04:11:06 EST
Considering the points made above, I am closing this as not a bug. If you think that is wrong, please feel free to reopen this.
Comment 9 manstis 2015-12-09 05:46:29 EST
2) and 3) I suspect this is caused by the introduction of the "package name white list". See https://bugzilla.redhat.com/show_bug.cgi?id=1155371 (where it was introduced) and https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/html/User_Guide/sect-The_asset_editor.html#Narrowing_Facts_Using_Package_White_List (that explains its use).
Comment 10 Eric D. Schabell 2015-12-09 08:19:55 EST
(In reply to manstis from comment #9)
> 2) and 3) I suspect this is caused by the introduction of the "package name
> white list". See https://bugzilla.redhat.com/show_bug.cgi?id=1155371 (where
> it was introduced) and
> https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/html/
> User_Guide/sect-The_asset_editor.
> html#Narrowing_Facts_Using_Package_White_List (that explains its use).
>
Thanks for the clarification Manstis,

So there are several comments I have to this:

1. no problem with white listing file for package names.

2. if it is not present (existing projects) it should be added with minimum default of the current project package. Maybe this should not need to be added to the white list file but just work out of the box?

3. existing projects with no white list are having very strange behavior as above and not a single clue as to why for customers / partners and field using it.

Where can or should these be added (so many bugs and comments referenced above and this bug closed as not-a-bug)???
Comment 11 Eric D. Schabell 2015-12-09 08:26:28 EST
(In reply to Eric D. Schabell from comment #10)
> (In reply to manstis from comment #9)
> > 2) and 3) I suspect this is caused by the introduction of the "package name
> > white list". See https://bugzilla.redhat.com/show_bug.cgi?id=1155371 (where
> > it was introduced) and
> > https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/html/
> > User_Guide/sect-The_asset_editor.
> > html#Narrowing_Facts_Using_Package_White_List (that explains its use).
> >
> Thanks for the clarification Manstis,
> 
> So there are several comments I have to this:
> 
> 1. no problem with white listing file for package names.
> 
> 2. if it is not present (existing projects) it should be added with minimum
> default of the current project package. Maybe this should not need to be
> added to the white list file but just work out of the box?
> 
> 3. existing projects with no white list are having very strange behavior as
> above and not a single clue as to why for customers / partners and field
> using it.
> 
> Where can or should these be added (so many bugs and comments referenced
> above and this bug closed as not-a-bug)???
>
The documentation states:

"This file is created automatically on the creation of a new project in the root directory, along with the pom.xml and project.imports project files. For existing projects, you may create this file manually."

In bug description above, this project setup was brand new, so the file was created and only lists:

com.redhat.coolstore.**

The default is too constricting, so opening this bug again and adjusted title to have this default be less constricting and prevent business users from creating data types in the project where they are not accessible.

How can one add all default Java types (Integer, String, etc... really need to add package structure for Java to whitelist)?
I will push an article out on this topic.
Comment 12 Zuzana Krejčová 2015-12-09 08:33:17 EST
(In reply to Eric D. Schabell from comment #10)
> Where can or should these be added (so many bugs and comments referenced
> above and this bug closed as not-a-bug)???

Because the issues listed are either not bugs or already reported (or both).
Comment 13 Zuzana Krejčová 2015-12-09 08:35:12 EST
(In reply to Eric D. Schabell from comment #11)
> (In reply to Eric D. Schabell from comment #10)
> > (In reply to manstis from comment #9)
> > > 2) and 3) I suspect this is caused by the introduction of the "package name
> > > white list". See https://bugzilla.redhat.com/show_bug.cgi?id=1155371 (where
> > > it was introduced) and
> > > https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/html/
> > > User_Guide/sect-The_asset_editor.
> > > html#Narrowing_Facts_Using_Package_White_List (that explains its use).
> > >
> > Thanks for the clarification Manstis,
> > 
> > So there are several comments I have to this:
> > 
> > 1. no problem with white listing file for package names.
> > 
> > 2. if it is not present (existing projects) it should be added with minimum
> > default of the current project package. Maybe this should not need to be
> > added to the white list file but just work out of the box?
> > 
> > 3. existing projects with no white list are having very strange behavior as
> > above and not a single clue as to why for customers / partners and field
> > using it.
> > 
> > Where can or should these be added (so many bugs and comments referenced
> > above and this bug closed as not-a-bug)???
> >
> The documentation states:
> 
> "This file is created automatically on the creation of a new project in the
> root directory, along with the pom.xml and project.imports project files.
> For existing projects, you may create this file manually."
> 
> In bug description above, this project setup was brand new, so the file was
> created and only lists:
> 
> com.redhat.coolstore.**
> 
> The default is too constricting, so opening this bug again and adjusted
> title to have this default be less constricting and prevent business users
> from creating data types in the project where they are not accessible.
> 
> How can one add all default Java types (Integer, String, etc... really need
> to add package structure for Java to whitelist)?
> I will push an article out on this topic.

And this is already reported, as I've pointed out in comment 6.
Comment 14 Eric D. Schabell 2015-12-09 08:38:32 EST
(In reply to Zuzana Krejčová from comment #13)
> (In reply to Eric D. Schabell from comment #11)
> > (In reply to Eric D. Schabell from comment #10)
> > > (In reply to manstis from comment #9)
> > > > 2) and 3) I suspect this is caused by the introduction of the "package name
> > > > white list". See https://bugzilla.redhat.com/show_bug.cgi?id=1155371 (where
> > > > it was introduced) and
> > > > https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/html/
> > > > User_Guide/sect-The_asset_editor.
> > > > html#Narrowing_Facts_Using_Package_White_List (that explains its use).
> > > >
> > > Thanks for the clarification Manstis,
> > > 
> > > So there are several comments I have to this:
> > > 
> > > 1. no problem with white listing file for package names.
> > > 
> > > 2. if it is not present (existing projects) it should be added with minimum
> > > default of the current project package. Maybe this should not need to be
> > > added to the white list file but just work out of the box?
> > > 
> > > 3. existing projects with no white list are having very strange behavior as
> > > above and not a single clue as to why for customers / partners and field
> > > using it.
> > > 
> > > Where can or should these be added (so many bugs and comments referenced
> > > above and this bug closed as not-a-bug)???
> > >
> > The documentation states:
> > 
> > "This file is created automatically on the creation of a new project in the
> > root directory, along with the pom.xml and project.imports project files.
> > For existing projects, you may create this file manually."
> > 
> > In bug description above, this project setup was brand new, so the file was
> > created and only lists:
> > 
> > com.redhat.coolstore.**
> > 
> > The default is too constricting, so opening this bug again and adjusted
> > title to have this default be less constricting and prevent business users
> > from creating data types in the project where they are not accessible.
> > 
> > How can one add all default Java types (Integer, String, etc... really need
> > to add package structure for Java to whitelist)?
> > I will push an article out on this topic.
> 
> And this is already reported, as I've pointed out in comment 6.

Ok, I also added java.lang.** and only get the possibility in a guided rule Config tab to add String and Integer, unable to get Float for example.... or other interesting types I might want to use in a rule.
Comment 15 manstis 2015-12-09 08:56:52 EST
Hi Eric,

Float, Integer etc are interesting.

Ignoring "Package Name White List" the Types available for Authoring need to be in the Project or its dependencies. Types in the JRE are neither and hence should be added to the Project's "import suggestions". See https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BRMS/6.2/html/User_Guide/sect-Project_Editor.html#Imports1 (you'll need to scroll down to the bottom). Once they've been added there you can include them using the Config tab in the editor and they can be used.

So, in summary:-

1) New Projects have a "Package Name White List" created containing, by default, the default package created for the new Project. If this file does not exist or is empty there is no filtering. Old Projects do not have the file and hence are not subject to filtering.

2) Types in the JRE should be added to the Project configuration using the "Import Suggestions" first and then made accessible to the editor using the Config tab.

3) The terminology is dire at best; and we've improved it in Community (see https://kie-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/kie-docs/lastSuccessfulBuild/artifact/drools-docs/target/docbook/publish/en-US/html/ch02.html#d0e491)

4) Package Name White List is currently being re-written for 6.4 Community too (see https://issues.jboss.org/browse/GUVNOR-2273).

If you can confirm #2 works, we can close this BZ as everything else is tracked elsewhere. Thanks.
Comment 16 manstis 2015-12-09 09:00:25 EST
Oh, I should add re: JRE Types. If a nested member returns a String, Float, float, Integer, int etc; e.g. Person( father.name == 'Fred' ); then you don't need to "import" them. It's only if you want to use them as the Pattern, e.g String( empty == false ) etc you need to jump through the hoops. "Number" is always added to the "Import Suggestions".. happy to add some more by default if it helps - against this BZ.. just let me know.
Comment 17 Eric D. Schabell 2015-12-09 09:02:08 EST
I played now with project.imports file and can add individual types, but can't just add java.lang.** to get them all on a Config -> Add listing. 

Seems like the white list and project.imports is a bit conflicting???
Comment 18 Eric D. Schabell 2015-12-09 09:04:40 EST
Final thoughts, feels like whitelist is some extra file to fix something. It feels more correct to deal with imports in project.imports (an already existing concept), just auto add project root (in my case above, allow for com.** to find all domain model types or add them one by one as they are created, up to your discretion).

Very confusing to have a project.imports and whitelist.... where to add what?
Comment 19 Eric D. Schabell 2015-12-09 09:09:28 EST
Just tested removing all white list entries (blank file now) and added com.* to project.imports, it now allows for artifacts Config -> Add to see all data types added in the project no matter where they land within com.redhat.coolstore...

Interesting... why the whitelist at all then?
Comment 20 Eric D. Schabell 2015-12-09 09:30:20 EST
Disregard above, figured out that the white list is restricting, so by blanking that file or removing it, all packages are listing and all new data types are available.

I think just not adding a default white lists that contains the deepest package in the project (in my case it added com.redhat.coolstore.** by default) would be the best option. 

That is the fix for this whole bug.
Comment 21 Eric D. Schabell 2015-12-09 09:37:45 EST
To be honest, thinking about this some more... 

Create a new project, the Artifact ID determines the default entry in the project white list for data model entries.

If we expect a user to put any data model data types into that package then why offer them a pulldown menu at creation time to select any package depth they want? It should just default to the package name in projects artifact id and hide these details from the user (business types are targeted for business central, they really don't care about packages)?

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