Book a Demo

Author Topic: How to use SchemaType.GetFacet(BSTR name)  (Read 4912 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
How to use SchemaType.GetFacet(BSTR name)
« on: January 02, 2022, 09:58:02 pm »
I was trying to figure out if a SchemaType element was redefined, so I took to the documentation hoping to find a helpful clue.
https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/sc_schematypeclass.html
Unfortunately there is no "IsRedefined" property, but there is an operation called GetFacet that accepts a parameter of type BSTR with the name name

The documentation says:

Quote
Returns the value of the named facet. 'Root', for example' returns a value indicating whether a type is a root element

Using it to figure out if this element is a root seems a bit pointless since we do have a poperty IsRoot, but I'm wondering what other "Facets" I can use it for.

I have a lot of questions when reading the documentation:
- Can it be used to figure out if an element is redefined?
- What are the other facets we can use it for?
- What is a BSTR? Is that just another name for a string? (that's what Visual Studio tells me anyway)
- What will the "value indicating whether...." be? The string "True", or "true", or "1" or "yes"

Does anyone have more experience with this GetFacet operation?

@Sparx: please update the documentation to actually say something useful

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to use SchemaType.GetFacet(BSTR name)
« Reply #1 on: January 05, 2022, 08:33:02 pm »
Nobody   :'(

I guess I'm one of the only ones using this part of the API.

I'll send an email directly to support. Hopefully they can shed some light on this topic.

Geert

PS. As a workaround I'm testing to see if the name of my SchemaType differs from the name of the model element, since redefined elements can't have the same name as the original. Not ideal, and certainly not clean, but it seems to do the job for now.
« Last Edit: January 05, 2022, 08:42:35 pm by Geert Bellekens »

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: How to use SchemaType.GetFacet(BSTR name)
« Reply #2 on: January 06, 2022, 01:25:28 am »
I'm not using it, but I didn't want you to feel you were all alone.
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to use SchemaType.GetFacet(BSTR name)
« Reply #3 on: January 06, 2022, 01:37:00 am »
I'm not using it, but I didn't want you to feel you were all alone.
Thanks Ian, much appreciated  ;D

Geer