Book a Demo

Author Topic: bug in ObjectType?  (Read 4413 times)

Kikai_no_Tenshi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
bug in ObjectType?
« on: April 11, 2007, 06:37:19 am »
Hello!

I just figured out that Root-Models count as otPackage instead of otModel, by using GetTreeSelectedItemType.

Is this correct or is it a bug? ???

thomaskilian

  • Guest
Re: bug in ObjectType?
« Reply #1 on: April 11, 2007, 11:20:29 am »
I would say: it depends. If it's undocumented, then the documentation is wrong. If it's documented, then: see the documentation. And last exit: if it's well hidden in the documentation wait to get blamed by Sparx ;)

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: bug in ObjectType?
« Reply #2 on: April 11, 2007, 11:34:12 am »
Package.IsModel() is a read-only attribute that "indicates if package is a Model or Package."

I think the intent is that you examine this value.
No, you can't have it!

Kikai_no_Tenshi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: bug in ObjectType?
« Reply #3 on: April 11, 2007, 11:42:40 pm »
Yeah it's working that way, thanks.  ;)

But now there is the question for me, why doesn't it work with GetTreeSelectedItemType, or more precise, why does GetTreeSelectedItemType return otPackage instead of otModel?

Or the other way, in which situation will GetTreeSelectedItemType return otModel as a value?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: bug in ObjectType?
« Reply #4 on: April 12, 2007, 01:14:36 am »
Frankly, I don't know if there is any circumstance where anything will return otModel - I've yet to see it happen.

Try creating a second root node - which should be a Model node - and see what is returned. Or, try applying the «model» stereotype to a package to see if EA uses that to distinguish the two.
No, you can't have it!

Kikai_no_Tenshi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: bug in ObjectType?
« Reply #5 on: April 12, 2007, 01:37:33 am »
Nope....

Neither creating a new Model Node, nor applying the "model" stereotype will return otModel.

But I think that the stereotype will not change the value of GetTreeSelectedItemType, because I have many Elements with different stereotypes and it always returns otElement.

But it's not so important to find out now, your solution worked fine and so we don't have to hurry  ;)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: bug in ObjectType?
« Reply #6 on: April 12, 2007, 02:16:12 am »
Quote
Frankly, I don't know if there is any circumstance where anything will return otModel - I've yet to see it happen.

I believe you are correct David and I think I know the reason:  otModel really stands for otRepository (that is the outermost container).  If you check, you'll find that there is NO otView at all (that's the hint)...  It's part of Sparx's sloppy naming process.  Terms are overloaded all over the place ("Project" being a prime example).  Elsewhere ([size=13]Import DDL from ODBC[/size]), I propose a more consistent set of names for these containers.   Perhaps Sparx could confirm or refute my hypothesis.

Perhaps we could vote for mine (or another - but more consistent nomenclature)

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!