Book a Demo

Author Topic: Automation  (Read 3916 times)

Maggie

  • EA User
  • **
  • Posts: 106
  • Karma: +0/-0
    • View Profile
Automation
« on: March 11, 2014, 10:21:39 pm »
Hi
Does anyone know if it is possible to set properties on an object that no interface exists for?
For example I can set an object's status field (element.status)
but not something like concurrency or cardinality.
How would I do something like that

Thanks

Magie

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automation
« Reply #1 on: March 11, 2014, 10:31:17 pm »
Hi,

if something isn't part of API you can use code like:
Code: [Select]
string updateStr = @"update t_object set classifier_GUID = '" + method.MethodGUID +
                   "' where ea_guid = '" + action.ElementGUID + "' ";
rep.Execute(updateStr);

Of course:Be careful and test it with non productive data.

There are two books from Thomas Kilian which might help you:
  • InsideEA
  • ScriptingEA


Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Maggie

  • EA User
  • **
  • Posts: 106
  • Karma: +0/-0
    • View Profile
Re: Automation
« Reply #2 on: March 11, 2014, 10:37:06 pm »
Thanks Helmut

Im pretty new to all this.
Please could explain what your code is doing and how I would run it

Thanks

Maggie

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Automation
« Reply #3 on: March 11, 2014, 11:13:46 pm »
Helmut's example is actually some C-dialect excerpt and it manipulates the table which holds the properties (visible and invisible) for all EA elements. So basically if you want to change those invisible things you might need to update the table directly using some script or add-in.

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Automation
« Reply #4 on: March 11, 2014, 11:20:54 pm »
Hi Maggi,

the code is part of a C# Addin and it writes to the repository by means of SQL (Structured Query Language).

The first line simply sets a variable with the SQL update Code.
The second line makes an undocumented EA API call to run the update to the repositoy.

If you are interested in Addin go to the community and search for Geerts Tutorial (First Addin in 10 Minutes).

With Addins you can do almost everything. Things not part of the API you can solve by SQL as described above.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)