Book a Demo

Author Topic: Complete trans event info from auto interface  (Read 3750 times)

Jim Beck

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Complete trans event info from auto interface
« on: February 12, 2010, 09:06:53 am »
Hi!  I am trying to get the complete state transition trigger information from within an add-in using the automation interface.

To start, I am using EASL_List in a code template with my state machine GUID as owner and the "Transitions" collection.  With each subsequent transition GUID (the argument to a second script like all EASL_List calls), I am calling my add-in with the transition GUID.

I figured out through hacking that state transition are really connectors in the object model EA.ConnectorClass.  I don't see anywhere in here to get the trigger information however.  I thought it would be elements of the transition or something, but there aren't any containers in ConnectorClass that have this information.   (I'm looking for the Name, Type and Specification values for each trigger that one enters in the tool for a transition in a state machine diagram.)

Where is the trigger information stored for state transitions in the EA object model?  I have gathered from the above that it is not stored under the transition.  I will keep looking at a level above or beside the connector level unless I hear from this thread.

Thanks!

Jim
« Last Edit: February 12, 2010, 09:22:21 am by jimbeck »

Jim Beck

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Complete trans event info from auto interface
« Reply #1 on: February 12, 2010, 10:50:44 am »
Some progress, almost there:

EA makes an object owned by your state machine of type Trigger (the Properites.Type for this item is "Trigger").  I got it the following way in my C# add-in:

argTransitionGUID passed in by my code template via EXEC_ADD_IN:

EA.Connector theTransition = Repository.GetConnectorByGuid(argTransitionGUID);
EA.Collection evs = Repository.GetElementsByQuery("Simple",theTransition.TransitionEvent);

This finds the trigger Element in the model with the name given by theTransition.TransitionEvent.  Now on to figuring out where the trigger information lies in the Element class (Name is obvious property, but don't see Type (signal,timer,etc.) or Specification yet).

I'll update you soon I hope,

Jim

Jim Beck

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Complete trans event info from auto interface
« Reply #2 on: February 12, 2010, 11:41:15 am »
Ok, some some luck.  You can get the Type of a trigger from the CustomProperties of a trigger element obtained the way I did in the previous post.

However, I cannot find the trigger Specification value yet.

Maybe it is not accesible through the automation interface (Nooooo!)

Anyone know?

Jim

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Complete trans event info from auto interface
« Reply #3 on: February 12, 2010, 07:40:17 pm »
Jim,

I don't know about this particular instance, but it happens now and then that something is not (readily) available through the API.

What I usually do in such cases is:
- Figure out where in the database the property I'm after is stored
- Use Repository.SQLQuery to get the details.
- If the property you are after is stored as an ID there will probably be an operation on the Repository class to retrieve the object based on its id.
- Otherwise you have no choice but to use the result of the SQLQuery to go further upon.

Geert

Jim Beck

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Complete trans event info from auto interface
« Reply #4 on: February 13, 2010, 02:32:10 am »
Thank you Geert I will try this and let you know.