Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1048265

Summary: Creating duplicate DRL silently overwrites
Product: [Retired] JBoss BRMS Platform 6 Reporter: Zuzana Krejčová <zkrejcov>
Component: Business CentralAssignee: Toni Rikkola <trikkola>
Status: CLOSED CURRENTRELEASE QA Contact: Zuzana Krejčová <zkrejcov>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: etirelli, jsvitak, lpetrovi
Target Milestone: CR1   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:17:13 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:
Bug Depends On:    
Bug Blocks: 999950    

Description Zuzana Krejčová 2014-01-03 14:43:33 UTC
Description of problem:
See summary above and step below.


Version-Release number of selected component (if applicable):
BPMS 6.0 ER7


Steps to Reproduce:
1. In some package of a project, create a DRL file. Via GUI or Git, doesn't matter.
2. Append some content to the file and save it.
3. In GUI, create the same file in the same project and package.
4. Reopen the file in the GUI.


Actual results:
File was silently overwritten, you get "Item successfully created" notification.


Expected results:
Pop-up with a warning, that such file already exists. No overwriting.


Additional info:
This seems to be issue only for the DRL files, e.g. Test Scenarios and Enumerations work as expected.
My guess is that the "feature" that automatically adds package declaration to each new DRL is somehow behind this.

Comment 2 manstis 2014-01-03 18:10:25 UTC
The cause was simple; we didn't check if the file existed before writing the content (with GIT if you write to a file that already exists you simply add a new version - hence the apparent "overwrite").

Comment 3 Edson Tirelli 2014-01-07 18:45:21 UTC
Toni, can you please cherry-pick this into 6.0.x as soon as the flags are set?

Comment 4 Toni Rikkola 2014-01-08 07:04:21 UTC
Will do.

Comment 5 Toni Rikkola 2014-01-08 07:07:05 UTC
(In reply to Toni Rikkola from comment #4)
> Will do.

6.0.x: https://github.com/droolsjbpm/drools-wb/commit/f2dcf0417