Book a Demo

Author Topic: Automation: Capabilities in Capabilities  (Read 4407 times)

eric.meredith

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Automation: Capabilities in Capabilities
« on: April 13, 2018, 07:41:29 am »
Appreciate any help I can get.

I have used the Excel Importer extensively to import Server Objects, Applications, and to create multi-level packages - so I'm familiar with the API interface.

I need to automate the insertion (later update) of Capabilities. Some of these will be decomposed into sub-Capabilities. From a UI perspective I can do everything I want/need, but with automation, I'm not even sure how to ask the right questions.

Yet, "Capabilities within Capabilities" leaves me blank. See this link for an example: https://drive.google.com/file/d/18Fyq6lBsjgLyNaKcl7Ef12oFcuqLNuRV/view?usp=sharing

tldr; What API do I use to add a Capability within an existing Capability.

Thx,
Eric

Nizam

  • Prolab Moderator
  • EA User
  • *
  • Posts: 320
  • Karma: +15/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Automation: Capabilities in Capabilities
« Reply #1 on: April 13, 2018, 08:41:26 am »
tldr; What API do I use to add a Capability within an existing Capability.

If I understand your question right, you may need two things
1. Get the GUID of your current capability (Use the Excel Exporter to get that) and try to synchronize in subsequent imports
2. Set the ParentID of Element (child capability) to create Capabilities within an existing Capability (Get the Parent Element by using GetElementByGUID)

Rich Anderson

  • EA User
  • **
  • Posts: 142
  • Karma: +8/-0
    • View Profile
    • LinkedIn
Re: Automation: Capabilities in Capabilities
« Reply #2 on: April 13, 2018, 02:27:05 pm »
I would recommend that you try creating a simple VB.Net program using Visual Studio Community Edition that reads the spreadsheet directly through the Excel API and then updates the EA model directly using the EA API.  In this way, you can bypass the whole problem of Excel importing.  You can just write a loop that goes down the rows and/or columns of the spreadsheet and plugs the elements and connectors into EA.  I do this all the time and have done some quite complex importing that way.
« Last Edit: April 13, 2018, 02:29:53 pm by Rich Anderson »
Rich Anderson
Urgnt Limited

eric.meredith

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Automation: Capabilities in Capabilities
« Reply #3 on: April 13, 2018, 11:51:37 pm »
Nizam - thanks, I will try - haven't used the ParentID thingy before.
Rich - I am not using an "Excel Import" per se - I am using VBA (effectively VB) to programmatically create and manipulate objects. I just didn't know how to create a child of a Capability.

Thanks to both for your replies.
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Automation: Capabilities in Capabilities
« Reply #4 on: April 14, 2018, 12:43:40 am »
You can just create elements in elements by using
Code: [Select]
newElement = Element.Elements.AddNew("name", "yourmetatypeorstereotype")
q.