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

Bug 1066616

Summary: POJO previously externally modified cannot be changed in the DM
Product: [Retired] JBoss BPMS Platform 6 Reporter: Zuzana Krejčová <zkrejcov>
Component: Data ModelerAssignee: Walter Medvedeo <wmedvede>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Kralik <pkralik>
Severity: urgent Docs Contact:
Priority: high    
Version: unspecifiedCC: althomas, etirelli, kverlaen, lpetrovi, paradhya, pzapataf, rrajasek, vigoyal
Target Milestone: ER2Keywords: Regression, TestBlocker
Target Release: 6.0.1   
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:03:05 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
Notification displayed if externally modified objects are detected when the model is opened
none
Mark for externally modfied objects none

Description Zuzana Krejčová 2014-02-18 17:42:25 UTC
Description of problem:
When the Data Modeler loads a project's model, it checks whether any class/data object was externally modified. If so and if the class is deemed as a "previous version" class, it won't be possible to change the class/data object via the DM. These classes are open in a read-only mode.

This actually means that developers (Eclipse plugin) and business users (Data Modeler) won't be able to cooperate.

It doesn't matter how far in history the external commit is - the Data Modeler is useless for imported repositories.


On a "funny" side note:
A class is from "previous version" if there is no hash in it's javadoc. This is not very good. Developers that have no idea what it is for may delete the hash. Or if a developer creates a class, he definitely won't add a hash to javadoc. So no matter which version of the product is used, DM will think the class is from some old version and won't allow editing.
The DM deems a commit external only based on the commit message, so this can be faked if a developer doesn't care for keeping the git repository clean.
See DataModelerServiceImpl.wasModifiedForOldFiles(..).


Version-Release number of selected component (if applicable):
BPMS 6.0.1 ER1

Comment 1 Walter Medvedeo 2014-02-20 10:39:14 UTC
At the moment those are the options we have:

1) When it's detected that a .java file was externally modified, we can put a small description e.g "(externally modified)" and let the user modify the data object from the datamodeler. The user should know that full roundtip is not implemented for this version.  
To implement that we have already a property that enable/disable the "read only mode feature". So we just have to add the e.g. "(externally modified)" description or whatever other extra information to the user.

2) Keep current verification, and if a file was externally modified the pojo is shown in read only mode.

Comment 2 Lukáš Petrovický 2014-02-20 13:38:17 UTC
Walter,

given the current limitations of the modeller, let's go with 1). It will allow people to perform modifications on the data at their own risk. (Since the other option doesn't prevent them anyway, just makes them harder.)

However, the description / alert / popup should clearly state that doing so may cause data loss when Git commits are also coming from outside of the WB.

We will also need to clearly document this. Vikram, can you make sure that the limitations of the Data Modeller make it into the Workbench documentation?

Comment 3 Kris Verlaenen 2014-02-20 14:42:48 UTC
+1 on first option

Comment 4 Prakash Aradhya 2014-02-20 14:44:24 UTC
Guys,
I agree with Lukas,lets go with option 1. 
Please keep it to limited code change. As little disruption as possible.

thanks

Comment 5 Walter Medvedeo 2014-02-21 12:12:12 UTC
The following commits implements option 1.

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

push 6.0.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/67cb051b5


Attached screenshots shows the information for the popup, and how an externally modified object is marked.

Comment 6 Walter Medvedeo 2014-02-21 12:14:30 UTC
Created attachment 865953 [details]
Notification displayed if externally modified objects are detected when the model is opened

Comment 7 Walter Medvedeo 2014-02-21 12:54:37 UTC
Created attachment 865980 [details]
Mark for externally modfied objects

Comment 8 Walter Medvedeo 2014-02-21 12:55:44 UTC
The following two additional commits are also related needed.

push master URL: http://github.com/droolsjbpm/kie-wb-common/commit/9fe037d18

push 6.0.x URL: http://github.com/droolsjbpm/kie-wb-common/commit/d1b1862ee

Comment 9 Pavel Kralik 2014-03-20 14:08:10 UTC
Externally modified POJO can be modified in the DM. The warning about external modification pops up. 

Verified for bpms-6.0.1-ER2 deployable for eap6.

Comment 10 Vikram Goyal 2014-05-23 07:03:51 UTC
I have added the note about synchronizing data between the DM and external sources as a warning in this section [1].

Please verify if this is correct.

Thanks. I am clearing the NEEDINFO.

[1] http://documentation-devel.engineering.redhat.com/site/documentation/en-US/Red_Hat_JBoss_BPM_Suite/6.0/html-single/User_Guide/index.html#Creating_a_data_object