Re: [mdr-users] RE : [mdr-users] RE : [mdr-users] Restoring data from XMI
Martin Matula <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Olivier, you summed it up correctly :). Martin Olivier RICHAUD wrote: >OK, in orde to fully understand Martin, I'm goig to sum my approach, and >then to sum up what you suggest, before all. > >For now, I differentiate to type of packages : >1. Business packages which model different systems, for example : > STBPM > BPM > < classes to model > > PolicyDeployment > < classes to model > > >2. Support packages > mood > diagrams > < classes to support diagrams > > >When we start our system, we make sure that mood.diagrams si loaded. >That package is designed to provide businesses classes with some >functionnalities and is to be clustered with each business package > >Now, when we load a business package, we ensure that every class that >has to parent class will inherit from MoodGraphable. This transparent in >our system. Extent for this model is thus created with the reference to >the ModelPackage passed in the array of RefPckage of createExtent. And, >of course, we add an import directive with isClustered set to true in >our BPM package. > >That way, we can work but reloading the BPM packages from XMI is >impossible. > >What you suggest : >1. First of all, make package "diagrams" a top level package, which >consists into removing the mood package. >2. If I want to access the same way as before my generated classes (we >use UML2MOF to create stubs), I need to attach a tag >"javax.jmi.packagePrefix" to the "diagrams" package. >3. Work as before, my problem shoudl be solved as diagrams is now a top >level package. > > >However, I want again to thank you for your time and your help. I now >have been working with MDR for two years, and it's a great pleasure to >have your support. > >Regards. > >Olivier. > > >-----Message d'origine----- >De : Martin Matula [mailto:[email protected]] >Envoyé : vendredi 8 avril 2005 17:39 >à : [email protected] >Objet : Re: [mdr-users] RE : [mdr-users] Restoring data from XMI > > >Olivier, >it seems (based on your e-mail) that your package structure is: > >mood > - diagrams > - MoodGraphable > >I.e. there is a mood package, which is toplevel, then there is diagrams >package which is nested in mood and then MoodGraphable is nested into >diagrams. (Although I cannot verify this since you seem to have attached > >a wrong (empty) XMI file.) >I am not sure why you used this structure. To fix this you should move >MoodGraphable and all packages that you want to cluster or instantiate >to the outermost level - make them top-level packages. >I don't know why you use nesting. If it is to achieve convenient package > >structure in java, please note that you can add javax.jmi.packagePrefix >tag (set to value "mood.diagrams") to the MoodGraphable package so that >the generated interfaces will still be located in >mood.diagrams.moodgraphable package. >Regards, >Martin > >Olivier RICHAUD wrote: > > > >>Can you elaborate more on this? I dont't understand what you meand by >>nested packages. I read the MOF1.4 specification, It isn't clear at all >> >> > > > >>for me. >> >>What suprised me is that I could work, create instances commit >>transactions. I could even start and restart MDR several times. I >>managed to save extents. But reloading XMI is an issue. >> >>Can you tell me what could be a solution? >> >>Regards. >> >>Olivier. >> >>-----Message d'origine----- >>De : Martin Matula [mailto:[email protected]] >>Envoyé : jeudi 7 avril 2005 10:34 >>à : [email protected] >>Objet : Re: [mdr-users] Restoring data from XMI >> >> >>Olivier, >>clustering is not supported for nested packages. From your description >>it seems that your MoodGraphable package is nested. >>Regards, >>Martin >> >>Olivier RICHAUD wrote: >> >> >> >> >> >>>Hi Martin, >>> >>>I have a problem I've never had when restoring instances of object >>>from >>> >>> >>> >>> >> >> >> >> >>>XMI. When I restore my system, here are the steps I follow : 1. I >>>restore all my models from their corresponding XMI files. I create an >>>extent - calling createExtent("name", null, null) - and use an XMI >>>reader to load data into the extent. 2. For each set of objects, I get >>> >>> > > > >>>the top level package of the corresponding model and pass it to >>>createExtent - calling createExtent("name", topLevelPackage, null) and >>> >>> > > > >>>of course, reload with an XmiReader the objects. >>> >>>This worked fine without clustered. Now, we use clustered packages, as >>>you explained how to use them. We can : 1. load a model (see >>>STBPM_1_7.xmi) and dynamically cluster package mood.diagrams so that >>> >>> >we > > >>> >>> >>> >>> >> >> >> >> >>>can make some of our class inherits from mood.diagrams.MoodGraphable. >>>2. Of course, we can create instacnes of objects which classes are >>>described into mood.diagrams. 3. We are able to backup our model and >>>our space of objects into XMI files (those which are attached). You >>>can notice that since our classes inherits from MoodGraphable which >>>has a representations association, >>> >>> >>> >>> >>the >> >> >> >> >>>XMI contains links (see tag >>>mood.diagrams.MoodGraphable.representations). >>> >>>In order to use clustering, we have added import directives and we >>>pass >>> >>> >>> >>> >> >> >> >> >>>a RefPackage array to createExtent (for both creating the model and >>>the >>>space) which contains a RefPackage (the extent of model containing the >>> >>> > > > >>>clustered package). The model is correctly restored. >>> >>>Now the problem is with restoring data : we can't restore data from >>>STBPM2004.xmi. I get the following exception : >>> >>>22:07:42,223 ERROR [STDERR] org.netbeans.lib.jmi.util.DebugException: >>>Element name cannot be resolved, unknown package: >>>mood.diagrams.MoodGraphable.representations >>>22:07:42,223 ERROR [STDERR] at >>>org.netbeans.lib.jmi.xmi.XmiContext.resolveElementName(XmiContext.java >>> >>> >: > > >>>5 >>>27) >>>22:07:42,223 ERROR [STDERR] at >>>org.netbeans.lib.jmi.xmi.XmiElement$Instance.startSubElement(XmiElemen >>> >>> >t > > >>> >>> >>> >>> >>. >> >> >> >> >>>java:502) >>>22:07:42,223 ERROR [STDERR] at >>>org.netbeans.lib.jmi.xmi.XmiSAXReader.startElement(XmiSAXReader.java:2 >>>1 >>> >>> >>> >>> >>9 >> >> >> >> >>>) >>>22:07:42,223 ERROR [STDERR] at >>>org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPa >>>r >>> >>> >>> >>> >>s >> >> >> >> >>>er.java:434) >>>22:07:42,223 ERROR [STDERR] at >>>org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBin >>>d >>> >>> >>> >>> >>e >> >> >> >> >>>r.java:571) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidato >>>r >>> >>> >>> >>> >>. >> >> >> >> >>>java:796) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement >>>( >>> >>> >>> >>> >>X >> >> >> >> >>>MLDocumentFragmentScannerImpl.java:752) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD >>>i >>> >>> >>> >>> >>s >> >> >> >> >>>patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1454) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XML >>>D >>> >>> >>> >>> >>o >> >> >> >> >>>cumentFragmentScannerImpl.java:333) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPa >>>r >>> >>> >>> >>> >>s >> >> >> >> >>>erConfiguration.java:529) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardPa >>>r >>> >>> >>> >>> >>s >> >> >> >> >>>erConfiguration.java:585) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147) >>>22:07:42,233 ERROR [STDERR] at >>>org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.ja >>>v >>> >>> >>> >>> >>a >> >> >> >> >>>:1148) >>>22:07:42,233 ERROR [STDERR] at >>>javax.xml.parsers.SAXParser.parse(Unknown Source) >>>22:07:42,233 ERROR [STDERR] at >>>org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:136) >>>22:07:42,233 ERROR [STDERR] at >>>org.netbeans.lib.jmi.xmi.XmiSAXReader.read(XmiSAXReader.java:98) >>>22:07:42,233 ERROR [STDERR] at >>>org.netbeans.lib.jmi.xmi.XMISaxReaderImpl.read(XMISaxReaderImpl.java:3 >>>7 >>> >>> >>> >>> >>) >> >> >> >> >>>Sure, I have missed something, but what? >>> >>>Thanks for your help. >>> >>>Olivier. >>> >>> >>> >>> >>> >> >> >> >> > > > >