We've recently made the decision to rename our base models, or what we call the virtual base layer, the virtual models all other models are derived from. While this seemingly updated the sql for all derived models correctly, we're now faced with a large number of errors of the following form:
|Unresolved reference "file:/<file_path_to_base_model>/<name_of_old_base_model>"||<model_name>||<model_path>||Container/Diagram/Entity||Problem|
Is there an easy way of fixing this?
Yes, of course I've used Refactor -> Rename. And unfortunately, trying to undo the rename caused a lot of subsequent issues in my model. What I did to revert the process was delete my entire project, and do a fresh checkout from the repository. And I, for one, can replicate the problem. Here's what I did:
1. Pick one of your base models. Not an imported data source, but a virtual base layer on top of it, from which you've derived multiple view models.
2. For this base model, do a Refactor -> Rename.
This will now rename the base model, and update the derived models. The sql of the derived models now reflects the renaming, but every derived model will now also be in an error state, all with the same error as shown in the OP.
I'm running the Designer 7.7 Final in Eclipse 3.7.2.
I'm trying to recreate your issues. Here is what I did:
1. I used JDBC importer to create a source model.
2. I created a new virtual model transforming the source model from created in step 1. Let's call this new virtual model MasterView. It is just a virtual copy of the source model.
3. I created a new virtual model transforming it from the MasterView model of step 2. Let's call this new virtual model View1.
4. I repeated step 3 five (5) more times. So now I have virtual models View1 through View6 all transformed from the virtual model MasterView. MasterView tables are the sources in all transformations.
5. I refactored/renamed MasterView to ViewMaster.
I am not seeing any problem markers in the Problems View for any of the models. The refactor looks like it worked fine. Do you believe these steps should've recreated the issue you are seeing?
If you could come up with a simple scenario like I just ran through that can recreate your issue please pass it on.
Sorry again for all the trouble.
Dan, as to your scenario, yes, that's essentially what I did, though it's been spread over quite a few different versions of the Designer, and there were a lot of model updates in between. As such, I'm not actually sure whether starting with clean models in the current Designer version will recreate the issue. I can replicate the issue with the steps I did in my current project. Unfortunately, I've got very tight deadlines at the moment and I can't take the time to try and recreate the issue any other way. What I'm primarily looking for here is not how to get to this error, but how to fix it quickly, even if it means I've got to update xml files manually. Any help with this would be much appreciated.
Mark, I'm running RHEL6.
I have found a way to duplicate your issue. For me to duplicate, I closed my project to unload all the model and diagram objects. Then reopened the project and then refactored/renamed the MasterView model (from above example) to ViewMaster. I then received the same type of errors you are getting.
There is a way to fix these errors by directly editing the model files. Here is what you can do:
1. For each model that has the error, open in a text editor.
2. Search for old name of the virtual model you refactored. It should be within a <diagramEntity> tag and will look something like this:
<diagramEntity xmi:uuid="mmuuid:7b7a4feb-190b-402f-bdbc-319a6acf392d" xPosition="328" yPosition="50">
3. Simply change "OLD-NAME-OF-MODEL" to the correct name. In my case, I changed:
4. After changing all affected files, the problem markers should go away and you should get a clean build.
So I believe the reason I wasn't seeing these errors initially is because all the models in my workspace had all be loaded/realized since each of them had been opened in a Model Editor. This was probably not your case. As a workaround, if you try this again, try opening all the involved models in an editor prior to refactoring.
Also, let me know if the hand-editing of the *.xmi model files works for you. You/I can write up an issue on this when I hear back from you.
Thanks for bringing this issue to our attention!
I did the workaround you suggested. I opened my project, and then opened all of the diagrams of every single model. After doing this, the refactoring went through without any reported errors. Saved me from having to manually edit the xml files. Thanks for the help, and do feel free to write up an issue for this.