Book a Demo

Author Topic: Schema composer API documentation wrong location  (Read 7580 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Schema composer API documentation wrong location
« on: January 05, 2016, 08:18:31 pm »
I was just looking for the API documentation in order to create a Schema Composer add-in, so naturally I looked at the Automation and Scripting Chapter in the Manual.
Much to my surprise I didn't find anything at all :o

Looking further I a little bit of documentation in the Schema Composer Chapter

@Roy, can you please set this straight?

There's also an error in the operation definition:

Code: [Select]
bool
EA_IsSchemaExporter (EA.Repository, ref string displayName);

The first parameter doesn't have a name.

Thanks

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Schema composer API documentation wrong location
« Reply #1 on: January 05, 2016, 09:10:35 pm »
Additionally the signature of the EA_GenerateFromSchema is not correct

It says:
Code: [Select]
void
EA_GenerateFromSchema (EA.Repository model, EA.SchemaComposer composer)

But in Rodrigo's example addin he uses the following signature:

Code: [Select]
public bool EA_GenerateFromSchema(EA.Repository Repository, EA.SchemaComposer composer, string exports)
I'm pretty sure Rodrigo's signature is the correct one, but it bothers me that I have to read it on his website and not in the help file.

I can guess from the example what the exports parameter is for, but what is the purpose of the boolean return value?

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Schema composer API documentation wrong location
« Reply #2 on: January 05, 2016, 10:34:17 pm »
And the documentation for SchemaTypeEnum is almost completely missing.

I'm a bit surprised when looking at this.
One would expect that EA.Composer.SchemaTypes would contain an EA.Collection of EA.SchemaType objects but NO completely in contrast with the rest of the API this contains an object of type SchemaTypeEnum.

Enum you say, so that must be an enumeration right? NO wrong again, it is an enumerator :-X :o
And the undocumented operations you can perform on this enumerator are GetCount, GetFirst and GetNext

So in order to loop the SchemaTypes in a SchemaComposer Object you have to do something like this:

Code: [Select]
public override void EA_GenerateFromSchema(EA.Repository Repository, EA.SchemaComposer composer)
{
foreach (EA.SchemaType schemaType in getSchemaTypes(composer))
{
//do something with schemaType
}
}

private List<EA.SchemaType> getSchemaTypes (EA.SchemaComposer composer)
{
EA.SchemaTypeEnum schemaTypeEnumerator = composer.SchemaTypes;
EA.SchemaType schemaType = schemaTypeEnumerator.GetFirst();
List<EA.SchemaType> schemaTypes = new List<EA.SchemaType>();
while (schemaType != null)
{
schemaTypes.Add(schemaType);
schemaType = schemaTypeEnumerator.GetNext();
}
return schemaTypes;
}

Who invents things like this ?!?

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Schema composer API documentation wrong location
« Reply #3 on: January 05, 2016, 11:48:08 pm »
Who invents things like this ?!?

I guess the developers at Sparx. Or the marketing that brought us so many new shiny features in EA that I can't count them. In that respect the development cycle at Sparx is very consistent.

q.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Schema composer API documentation wrong location
« Reply #4 on: January 06, 2016, 03:58:45 pm »
Hi Geert,
Thanks for bringing these to our attention.  I'm working with Roy at the moment to see if we can fix some of those holes in the API documentation.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Schema composer API documentation wrong location
« Reply #5 on: January 06, 2016, 05:13:58 pm »
Thanks Aaron (and Roy)

Geert