Book a Demo

Author Topic: Adding operations as scripted CSV import  (Read 3702 times)

andykennelly

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Adding operations as scripted CSV import
« on: March 16, 2013, 01:51:26 am »
I've tailored Geert's function import (from the community site) in order to CSV import various things. What I'm stuck on is adding an operation under a component. I can't find how I'd do something equivalent to Geert's code:-
Dim currentAttribute As EA.Attribute

I try Dim currentOperation As EA.Operation, but I then get an error message "User defined type is not defined".

Can anybody tell me if there is an equivalent to the arrtibute adding function that will allow me to add an operation?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adding operations as scripted CSV import
« Reply #1 on: March 16, 2013, 02:08:54 am »
To add an operation you need something like Ea.Method. (Interestingly the internal table is called t_operation)

q.

andykennelly

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Adding operations as scripted CSV import
« Reply #2 on: March 16, 2013, 02:16:17 am »
Thanks Q.
Do you know if there is any help material that I might have used to find that out myself?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adding operations as scripted CSV import
« Reply #3 on: March 16, 2013, 04:11:35 am »
Have a look into my book Scripting EA  :)

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding operations as scripted CSV import
« Reply #4 on: March 18, 2013, 10:45:10 pm »
Andy,

The main documentation is in the help file (section Automation and Scripting)

Then there are a few examples in the EA distribution, on the main website and on the community site.

You can also have a look at my codebase on github: https://github.com/GeertBellekens/

Geert