Community
Participate
Working Groups
as discussed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=543231 and https://www.eclipse.org/forums/index.php/m/1834967/#msg_1834967 it is not obvious how to save a url model to a file with stereotypes applied. There are several gotchas as discussed in the forum thread thread above. I have modified IntroductionToUMLProfiles.java to include examples of hoot save a model with stereotypes applied in Java, the code is at https://www.eclipse.org/forums/index.php?t=getfile&id=39380&. To be complete and reasonable this most probably ought to have some updated url to show hoot do it in the ui (though I am not sure how that works...)
fumble fingers, here is a correct version: As discussed in https://bugs.eclipse.org/bugs/show_bug.cgi?id=543231 and https://www.eclipse.org/forums/index.php/m/1834967/#msg_1834967 it is not obvious how to save a uml model to a file with stereotypes applied. There are several gotchas as discussed in the forum thread thread above. I have modified IntroductionToUMLProfiles.java to include examples of how to save a model with stereotypes applied in Java, the code is at https://www.eclipse.org/forums/index.php?t=getfile&id=39380&. To be complete and reasonable this most probably ought to have some updated html to show how to carry out the same operation in the uml2 ui (though I am not sure how that would work as its not clear how to create a resource before the file is saved or how to add the applied stereotypes when editing is complete... however, maybe this is something that is solved in the ui code already)
Your mail group message seems to suggest that the contribution is incomplete; a missing ecore namespace declaration and a missing schemaDeclaration. The schemaDeclaration is probably a trivial Resource saveOptions bug. The missing ecore namespace may be a similar problem to https://bugs.eclipse.org/bugs/show_bug.cgi?id=568819 where a types declaration is missing. Perhaps some loop over transitive dependencies is missing that locates the required declarations.
Hi Ed the example is not incomplete it all works fine, the problem is that when I try and setup a parallel version of the code in my program I don't get the same results.... regards Gary
so in my own code when saving I needed to add xmiResource.defaultSaveOptions.put(XMIResource.OPTION_SCHEMA_LOCATION, true) but this isn't in the example code, not quite sure whey the two need different treatment
Probably because you are actually using the result whereas the example was developed as a demonstration that was 'tested' by eye.
(In reply to Ed Willink from comment #5) > Probably because you are actually using the result whereas the example was > developed as a demonstration that was 'tested' by eye. Unfortunately that's not the reason as its a runnable example and all works when run...
Created attachment 288418 [details] Better documentation and save Attached is rescued from my workspace. It seems that I was motivated to do better and so the attached was created on 21 November 2020, 18:38:02 It seems that it never got contributed. It solves the problems in https://www.eclipse.org/forums/index.php/mv/msg/1110528/1851540/#msg_1851540
(In reply to Ed Willink from comment #7) > It seems that it never got contributed. The code seems ok, but there is clearly at least one new half-written comment. Inspecting my email at the time, it appears that all the builds started failing the following day as Java 11 started to impose itself via Tycho / Maven currency. I suspect that I got interrupted while tweaking the comments and then got well distracted by fixing OCL, QVT, ... and forgot to come back to it.