Bug 1002370
Summary: | Guided Rule Editor: Add size related operators for Collection properties | ||
---|---|---|---|
Product: | [Retired] JBoss BRMS Platform 6 | Reporter: | Toshiya Kobayashi <tkobayas> |
Component: | Business Central | Assignee: | manstis |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Sona Mala <smala> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 5.x.x | CC: | etirelli, kverlaen, manstis, mwinkler, rrajasek, rzhang, trikkola |
Target Milestone: | ER3 | Flags: | smala:
needinfo-
|
Target Release: | 6.0.2 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-08-06 19:53:00 UTC | 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: |
Description
Toshiya Kobayashi
2013-08-29 03:35:16 UTC
Toni Rikkola <toni> updated the status of jira GUVNOR-2048 to Resolved Toni Rikkola <toni> made a comment on jira GUVNOR-2048 With the new data model oracle this is not an issue anymore. This affected 5.5.x, but not an issue anymore since the new data model oracle does not filter out size(). So no commits. The ticket is out of date. I can reproduce this issue for 6.0.0 ER7. I've created two facts: -> Employee (String: name) -> Company (Employee[0..N]: employees) For expression editor: - I can create employees.size but an operator selector contains just these comparisons (egual to | not equal to | is null | is not null) - I expect that there should be same operators as for number (the type of return value) - for example is grater than, is less then, etc. Additional info: field employees is represented as "private java.util.List employees;" instead of "private java.util.List<Employee> employees;". I am not sure if this is a problem, because method size() does not depend on generic type <Employee>. This is caused by the referenced BZ. Operators are looked-up from the Fact and Field; however in the case of this BZ the field completions for "Collection" have not been loaded (for some reason -- that will be the cause of this BZ). As an aside, there is a (clumsy) workaround:- (1) Ensure you have Collection as a Project "Import Suggestion" (2) Ensure you have added Collection as an import to the rule (3) Add a Collection Fact to the rule (4) Add whatever you need to the rule (e.g. "Person( employees.size() > 0 ) (5) Delete Collection from the rule OK, fixed. Please note in order to see the details of any sub-field (e.g. fields on a Type) the Type needs to either be in the same package as the rule, or imported. See steps (1) and (2) in comment #8. I can still reproduce this issue. There are steps to reproduce: 1. create a new project (org.test:bugTestProject:1.0) 2. open Data Modeler: a] create fact "Employee" with field "name" (select type String) b] create fact "Company" with field "employees" (select type Employee[0..N]) 3. open Project editor a] go to "Imports: Import Suggestions" b] add New item (java.util.List) c] Save changes in project and close it 4. create new guided rule "test" a] go to "Config" and add "java.util.List" b] go to "Edit" c] add fact Company into condition part (WHEN) d] click on "There is a Company with:" and choose "Expression editor" e] choose field "employees" f] choose method size() g] show options for operator Options are "equal to", "not equal to", "is null", "is not null". I think that the method "size" return Integer and valid operators are "is greater than", "is less than" etc. master https://github.com/droolsjbpm/drools-wb/commit/58ac824c4 6.0.x https://github.com/droolsjbpm/drools-wb/commit/b7b234f54 This issue is fixed partially in 6.0.2 ER2 BRMS. The expected list of operators (with options for Integer) is shown only if the user does not add "import suggestion". I use steps in comment #11 for verification. If I skip steps 3 and 4a then the expected list of operators is shown. If I perform all steps then the list of operators contains just Object operators. There is a workaround. Reopen a rule! Verified on ER3. Import suggestions have to be set only if fact is not created in the same package. Test scenario performs correctly such guided rule. |