Book a Demo

Author Topic: Creating structured activities (and corr. diagram)  (Read 2862 times)

popocatepetl

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Creating structured activities (and corr. diagram)
« on: May 21, 2007, 10:00:46 pm »
Hi,

We are using EA for business process modelling purpose. As such we have defined a series of UML patterns in order to facilitate the generating of Ericson-Charts and other stuff. As there arose the necessity for generating kind of templates that consists of an hierarchical structure of packages and diagrams (structured activities), I tried to program an Add-In that generates the desired structure using the automation interface.

After some successfull tries I am stuck now at the moment when I want to generate a "Structured Activitivity" (of course with the corresponding linked diagram).

To this end, I first create the element via:

   Element1 = package.Elements.AddNew("MyStructActivity", "Activity")

As there is no type "Structured Activity" I use Activity.

Then I add a diagram to this new Element1 via

   Diagram = Element1.Diagrams.AddNew(DiagramName, "Activity")

I change the type of Element1 to subtype = 8 via

   Element1.Subtype = 8

I played also around with the order of setting the subtype (before and after creating the diagram, but alas, ...).

I found out that additionally the
   Element1.MiscData(0)

should contain the ID of diagram, but I don't know how to change the value. Before starting playing around with creating new classes to make the read only methode R/W, I ask, because most probably there is a foreseen method to do what I want.

Is there somebody out there who can provide some hints?

By the way, (I refer here also to the post of Stephanie from May, 6th, 2007), is there any more detailed documentation of the automation interface than the EA User Guide? I think such a docu would also slove my problem here.


Regards,

Sigi

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Creating structured activities (and corr. diag
« Reply #1 on: May 22, 2007, 02:50:50 am »
There is no way (at least up to 6.5) to modify the MiscData fields, at least from within the API. I am hopeful (without any particular reason) for this to change in version 7.

You can write a second thread that updates the field via a direct link to the repository. In all but the Standard (desktop) edition, this will work (I think the desktop edition opens EAP files with a write lock by default). If you do this be very careful to preserve any other information that is in the field, since it is used for several things.

David
No, you can't have it!