This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Steps to reproduce: - create new BPEL Sync sample project - DO NOT open the diagram - deploy the project - open the BPEL diagram - try to drag an activity from palette to the diagram - the diagram will be in readonly mode, special message will be displayed and no editing will be allowed
Model which is used to deploy BPEL on server has ModelSource with editable flag FALSE. After deployment it is impossible to obtain model which has ModelSource with editable flag TRUE.
Mikhail, would you please check when this issue was introduced into Gavotte
This was reproducible in Coke already (I rechecked today). We could see Readonly diagram several times when doing Coke release and this was discussed with Mike Frisino but the exact steps to reproduce were not known. Actually I was sure there was an issue filed for Coke for this but I could not find it. I decided to create a new issue when we found out the scenario to reproduce the problem
Based on the test case steps, my guess is that deployment invoke some validation *ant task* which causing loading of ReadOnlyAccess model. Maybe this read-only model is still in cache when subsequent call to getModel() from the *editor* return the same ReadOnlyAccess model. If this theory is true, try calling AbstractModelFactory.createFreshModel() instead of getModel() in the ant task code. This will not cache the model.
CompApp Project does not load BPEL model in its own ant task. However, at CompApp build time, it invokes the "dist_se" ant task from BPEL projet, which seems to load the BPEL model in readonly mode. To reproduce this problem without CompApp being involved, do the following: 1. Create new BPEL SynchrousSample Project, 2. Go to Files tab, 3. Select build-impl.xml under BPEL project's nbproject directory, 4. Invoke the Run Target->Other Targets->dist_se action from the context menu, 5. Open the BPEL diagram 6. Try to drag an activity from palette to the diagram - the diagram is in read-only mode. Reassigning to BPEL project...
Alexey do you have enough information to fix the bug ?
Yes. Described scenario reproduces bug.
The problem is exactly in loading bpel model in RO mode. After this load BpelModel is cached and subsequent access to model via model source returns RO Model. This situation is common. So I suggest to correct ModelAccessProvider implementation in the way of returning different keys for ModelSource that are readonly and writable ( but was created with the same DataObject f.e. ). Such correction will fix any possible problem with performance and cached models. Nam, could you please review this suggestion. If my suggestion doesn't work for some reason for you then I will just change implementation of Bpel Model Factory in that way. But I prefer to do this in XAM level due general situation.
I has been thinking about the this bug. The cache has no distinction b/w readonly and writable instances. Will address this. Denis suggestion on the key is on the right track.
One more thing here actually. My suggestion will introduce another problem that we need to handle also and this already should be done on deploy side. Here is situation: Deploy will ask model with RO ModelSource and get it. DataObject will ask model with RW Model source and get another OM. Design allow to modify RW model and it can be changed. But in the same time RO model is not modified. So RO model will be always in the state of first creation. So deploy task will always use original OM but not current. This is a problem. Nam, could you provide to me details about possibility to ask Model via RW model source? What will happen if I try to get OM with RW ModelSource, but there is no RW Providers ? Will I get in this case null or some exception occurs ? I think we need to rewrite deploy task in the way always asking RW Model and if it is not possible then asking RO Model.
The cached RO model should be refreshed with changed from Design because build should have saved the buffer. However, it would be more efficient if in-IDE deploy and design use the same model. So, for now please forget about 2-keys solution. Can you change such that deploy create model source with writable flag. Remember the semantics of the editable flag in ModelSource is that in general, only auto-downloaded model sources (in temp directory) should be mark as non-editable. All model sources part of project source should be obtained with editable flag, even in ant task.
Thanks Nam, we will do it.
Fixed. Now in ../anttasks/.../IDEBPELCatalogModel.java is obtained from editable model source.
WinXp build 070226_1