Book a Demo

Author Topic: linking to Collection<SomeType>  (Read 4319 times)

DBRN

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
linking to Collection<SomeType>
« on: October 23, 2014, 04:52:50 am »
Hello. How do you find out where exactly the problem is when the XMI import file looks like this:

Add Classifier... [a few hundred times]

Resolving Classifiers
Resolving Owners
Resolving Attribute Types
Resolving Parameter Types
Error: Unknown Package Connector Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Dependency Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Dependency Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Package Connector Source or Target
Error: Unknown Package Connector Source or Target
[... a few hundres similar lines]
Resolving Association-Classes
Resolving DiagramIDs
Resolving Note links
Fixup external references
Import Complete!


Is there any way to find out which package connector or dependency exactly has been tried?
« Last Edit: October 23, 2014, 07:08:56 am by cafebabe »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: XMI Import: Error: Unknown Package Connector S
« Reply #1 on: October 23, 2014, 05:24:47 am »
No way (I know). There is a dangling connector into some (not yet) loaded XMI of some other package. As soon as you load that (good luck in finding it) the links are resolved.

q.

DBRN

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: XMI Import: Error: Unknown Package Connector S
« Reply #2 on: October 23, 2014, 07:06:12 am »
I think I figured out what exactly is not being resolved:
the parameters and return types of Collection<SomeType>.

SomeType, be it from Java API or my own libraries, is being imported; when I have String or MyOwnClass as parameters for example, they are being shown in the import, but as soon as I want a List/Set/Collection of them, I get method names like getAll(?).

Now how do deal with it?

Is there any way to show Collection<SomeType> in the Project Browser (ie without reducing it to a single SomeType), but make it link to SomeType instead of java.util.List in the diagram? (maybe it happens automatically, I have not tried out yet, I better ask before changing lots of code).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: linking to Collection<SomeType>
« Reply #3 on: October 23, 2014, 08:05:27 am »
Use a Search. You need to ex-/import the whole package (at least the sub-package where it's located). Eventually you can create a temp folder, move the element therein and ex-/import that before moving it back.

q.
« Last Edit: October 23, 2014, 08:06:15 am by qwerty »

DBRN

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: linking to Collection<SomeType>
« Reply #4 on: October 23, 2014, 07:41:47 pm »
Quote
Use a Search. You need to ex-/import the whole package (at least the sub-package where it's located). Eventually you can create a temp folder, move the element therein and ex-/import that before moving it back.
 
q.
Thanks for the reply, but what do you mean by moving things in temp folder and back? You mean putting all needed standard java libraries into one <packagedElement>and reference that? I thought you can reference those without <elementImport ...> because they are saved in the EA and you are able to simply identify them by EA_Java_StandardJavaApiType.

Right now the code I am working on uses <ownedParameter xmi:id="..." name="..." direction="return" type="EA_Java_CollectionType_TypeInsideCollection_"> for example. So you are telling me this is correct and only the <elementImport ...> of CollectionType for the <packagedElement> is missing?

And I did try to search for a guide. Google barely gives any results. If you can link me to one, that would be really helpful.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: linking to Collection<SomeType>
« Reply #5 on: October 24, 2014, 12:03:56 am »
If you have dangling references from an exported package which go into multiple elements in different packages and you just need them for reference then you can move all those into a single temporary package. This temp package can be ex-/imported as usual and will help to resolve the dangling references in the model where you imported your main package. Afterwards you can move the elements back to where they were first.

I do not look into XMI and don't try to understand it. So I can't help with that.

What kind of guide are you looking for?

q.