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

Bug 994559

Summary: Cannot remove fact from data model after its POJO was deleted manually
Product: [Retired] JBoss BPMS Platform 6 Reporter: Jiri Locker <jlocker>
Component: Data ModelerAssignee: Walter Medvedeo <wmedvede>
Status: CLOSED CURRENTRELEASE QA Contact: Zuzana Krejčová <zkrejcov>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: jskeoch, lpetrovi, mbaluch, pzapataf, wmedvede, zkrejcov
Target Milestone: ER5   
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:08: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:

Description Jiri Locker 2013-08-07 13:51:12 UTC
Description of problem:
Adding new object generates a POJO. If you open and delete the file and go back to Data modeler, the object type is still there. So I remove it and try to save the model. That fails with org.kie.commons.java.nio.file.NoSuchFileException presented in a error popup message.

Version-Release number of selected component (if applicable):
CR1 (community)

Actual results:
Deleting a POJO file doesn't update data model and the object type cannot be removed.

Expected results:
After deleting a POJO file the object type shouldn't be listed in data model. If it is, it should be possible to remove it and save the model.

Comment 1 Walter Medvedeo 2013-08-30 11:26:21 UTC
With current definition (and implemented functionality) .java files should be generated and managed from the data modeler tool, and not individually.

In order to let the user see the auto-generated java code for a given java pojo, a new specific java editor was provided. This editor works in read only mode.

When the user clicks on a .java file the new editor will be opened.

(if the user wants to delete a previously generated .java pojos, he shoud open the data modeler, delete de desired pojo, and save the model.)


The new editor was implemented in the following commits:


droolsjbpm-build-bootstrap project:
-----------------------------------------
    master branch: http://github.com/droolsjbpm/droolsjbpm-build-bootstrap/commit/df0f57c8e

    6.0.x branch: http://github.com/droolsjbpm/droolsjbpm-build-bootstrap/commit/e68694ca9


kie-wb-common project:
-----------------------------------------

    master branch: http://github.com/droolsjbpm/kie-wb-common/commit/5fa2c2674

    6.0.x branch: https://github.com/droolsjbpm/kie-wb-common/commit/38a4b99b9


kie-wb-distributions project:
------------------------------------------

    master branch: http://github.com/droolsjbpm/kie-wb-distributions/commit/c373974d7

    6.0.x branch: http://github.com/droolsjbpm/kie-wb-distributions/commit/ce6ee1734


drools-wb project:
------------------------------------------

    master branch: http://github.com/droolsjbpm/drools-wb/commit/0cacfc9bd

    6.0.x branch: http://github.com/droolsjbpm/drools-wb/commit/9179fcd4a

Comment 2 Lukáš Petrovický 2013-09-02 12:48:24 UTC
Bug 1001561 comment 2 applies here as well. External commits (including asset deletion) must be supported.

Comment 3 Zuzana Krejčová 2013-09-24 10:18:06 UTC
The same as bug 1001561 - POJO was deleted from git, the change pushed to .niogit. Project Explorer reflected this change, Data Modeler didn't. Deleting POJO in DM and trying to save produced error as before.

Comment 7 Walter Medvedeo 2013-10-11 16:17:02 UTC
Several changes was done in order to keep the project and the data modeler synchronized with external changes (via push), and also to keep track of concurrent modifications of the model in another data modeler editor window.

In general the same way as in the other editors, when external changes are detected the user is informed (using popup windows) an he can decide between "Ignoring" or "force writing" or "reloading the model"  (loosing current changes)

In general the data modeler window can have one of this two status: 

"Dirty": (the user that is editing the model has done some modification and not saved yet) 
"Clean": (the user opened the window but has not change anything).

In the following lines I'll describe shortly what happens when "an external" change to the model is produced. 
(an external change the model can be produced because of the following scenarios:
1) a user modified/removed/added a pojo .java file and pushed it via git
2) another user working in another editor window saves the model.
3) another user working in the project editor saves the project.

For the three scenarios, the data modeler editor will react in this way.

"Dirty":
If current window is dirty, and an external change is produced the user will immediately receive a popup window with the options "Reload" / "Ignore".

"Clean":
If current window is clean, and an external change is produced the data modeler will remember that an external change was produced, and as soon as the user tries to change something in current data model, It will receive a poup window the options "Reload" / "Ignore".

The clean status case works in this way by definition in order to not disturb users that was only taking a look a the model.

Then, as general rule for ALL cases: "if the user editing the model tries to save the model and an external change has bean produced the user will receive a popup window with the options "Force write" / "Reload". (the same as for the other editors.)

The following commits has the modification.

master:

http://github.com/droolsjbpm/kie-wb-common/commit/469011052
  
6.0.x:

http://github.com/droolsjbpm/kie-wb-common/commit/2ab5ba576

Comment 8 Walter Medvedeo 2013-10-11 16:34:38 UTC
I forgot one last comment, at this moment we don't have yet a "BatchUpdateEvent" . So if user A is editing the model, and user B saves the same model in another window e.x. generating three new files A.java, B.java, C.java, user A will recieve three notifications.
BatchUpdateEvent will be implemented and when we have them the user will receive only one notification in this case.

Comment 9 Zuzana Krejčová 2013-12-11 11:14:01 UTC
It is now possible to remove the POJO from DM without errors (though the DM still doesn't reflect the change made through git, see bug 1001561).