Bug 1173089

Summary: Default Position value doesn't take into account superclasses
Product: [Retired] JBoss BRMS Platform 6 Reporter: Zuzana Krejčová <zkrejcov>
Component: Data ModelerAssignee: Walter Medvedeo <wmedvede>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0CC: etirelli, kverlaen, lpetrovi
Target Milestone: ER5   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:36:39 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:
Attachments:
Description Flags
screenshot none

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.