Book a Demo

Author Topic: EA api - create parameter  (Read 5226 times)

naxx

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
EA api - create parameter
« on: May 06, 2016, 11:02:13 pm »
Hello, How I can create method parameter?
For example, I created object attribute (Archimate):

Code: [Select]
Attribute attribute = this.innerElement.GetAttributes().AddNew("someName", "");where innerElement is defined -
Code: [Select]
Element innerElement
Thanks

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: EA api - create parameter
« Reply #1 on: May 07, 2016, 03:59:44 am »
Hello naxx, and welcome to the forum.

I'm not sure where you've got GetAttributes() from - that's not in the API (not the documentation, anyway).
But most everything in EA is created in the same fashion: by calling AddNew() on the appropriate Collection.
An Element has a collection of Methods, and each Method has a collection of Parameters.

So just get hold of the correct Method, and call AddNew() on its Parameter collection.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA api - create parameter
« Reply #2 on: May 07, 2016, 04:50:36 am »
I'm not sure where you've got GetAttributes() from - that's not in the API (not the documentation, anyway).
I think that's the Java equivalent to Element.Attributes

Geert