Bug 1173089 - Default Position value doesn't take into account superclasses
Summary: Default Position value doesn't take into account superclasses
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Data Modeler
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER5
: 6.1.0
Assignee: Walter Medvedeo
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-11 12:44 UTC by Zuzana Krejčová
Modified: 2020-03-27 19:36 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:36:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
screenshot (35.24 KB, image/png)
2014-12-11 12:44 UTC, Zuzana Krejčová
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1173075 0 medium CLOSED Editor shows Position 0 even when no @org.kie.api.definition.type.Position is defined 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1196105 0 medium CLOSED Superclasses and @Position on fields - duplicate position value not detected 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1196106 0 medium CLOSED [guided rule editor] duplicate @Position value not handled well 2021-02-22 00:41:40 UTC

Internal Links: 1173075 1196105 1196106

Description Zuzana Krejčová 2014-12-11 12:44:43 UTC
Created attachment 967217 [details]
screenshot

Description of problem:
When creating data objects in the Data Modeler, the Position parameter/annotation is mandatory, but the defaults are not handled very well.
Parent data object has a field (of any type) with the default value for Position. If you create a data object that extends this class and add a field while, again, leaving the default Position value, both fields will have Position 0.
If you validate these data object, both seem just fine, no errors are returned.
If you try to to validate a rule (using the second data object) though, an Error pop-up is displayed (see screenshot) with no message. Server log and Problems panel contain messages like this: "Duplicated position 0 for field 'f1' on class org.C2".


Version-Release number of selected component (if applicable):
6.1 ER2


Steps to Reproduce:
1. Create a data object C1 with field f1, leave the default Position value. Save.
2. Create a data object C2, set the superclass to C1, add field f2, leave the default Position value. Save.
3. Validate both data objects.
4. Create a guided rule, add C2 to 'when' section.
5. Validate the guided rule.

Actual results:
Step 3 - no errors.
Step 5 - Error pop-up with no message, validation fails.

Expected results:
A:
Step 3 - Error pop-up warning about duplicate position, validation fails.
Step 5 - Error pop-up warning about duplicate position, validation fails.
B:
Step 3 - no errors - field f2 in C2 is created with a different default value.
Step 5 - no errors.

Comment 1 Zuzana Krejčová 2014-12-11 12:53:54 UTC
Just realized you cannot simply fix the Position value in the Data Modeler - the Position editable element is a select box and other values are not available.
The only option is to manually edit the java source. 
Raising severity.

Comment 2 Walter Medvedeo 2015-01-21 10:28:08 UTC
The positions usage was reviewed, and now applies the following new criteria.

It was found that the @Position is used in a low percent of drools rules/applications. So the auto-calculation of the position (when the position is missing in the .java file), and the position assignment by default when a field is created in the UI were removed.

Advanced drools users that has the need to use position, tipically in a subset of the class fields, can then manually assign/modify the position.

The position column was also removed by the same reason, position is used by advanced drools users in a low percent of cases and confuses business users.

The following commits solves the issue:

 master URL: http://github.com/droolsjbpm/kie-wb-common/commit/e822d9333


 master URL: http://github.com/droolsjbpm/kie-wb-common/commit/d9812a09e


 push 6.2.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/3a73a8c55


 push 6.2.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/f3fa0582b

Comment 3 Zuzana Krejčová 2015-02-25 10:24:07 UTC
The issue with defaults is fixed - there are no troublesome defaults.
The rest of the issues are now covered by bug 1196106 and bug 1196105.


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