Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - fginfrance

Pages: [1] 2
1
Automation Interface, Add-Ins and Tools / Re: Automation using Python?
« on: March 14, 2011, 08:00:59 am »
It is actually quite straight forward.

You have to get and install the pywin package for the python version you use (me its py2.6)
With that , the EA API is wrapped and becomes available "by magic".

The following is a starter snippet for a python app that connects to an open EA model. To use it, you have to manually open a model and than execute your script. All EA API is available!

Writing EA plug-ins in python also works, but is a different story...

Have fun...

Code: [Select]
import win32com.client


      try:
        eaApp = win32com.client.Dispatch("EA.App")
      except:
        sys.stderr.write( "Unable to connect to EA\n" )
        exit()

      # from here onwards, the full EA API is available as python objects
      # so we can

      mEaRep = eaApp.Repository

      if mEaRep.ConnectionString == '':
        sys.stderr.write( "EA has no Model loaded\n" )
        exit()

      else:
        print "connecting...", self.mEaRep.ConnectionString

fginfrance

2
Thank you guys!

Especially also for the hint on the "magic" search button on the LEFT, so well hidden and so much more useful than the field on the RIGHT  ;)

Regards
Frank

3
Hello,

I have a question especially for those long-time experts.
Was there an issue with the behaviour of package.Elements() method. Do I remember correctly that it changed behaviour somewhere between v. 7.x and 9.0 from returning all Elemnts of a package to only returning top-level Elements - for which you have to call element.Elements method to have the child-elements?

I have the impression to remember a post like that, but I am unable to find it in the forum (if it really exists) and we have to anticipate the effort on porting a large toolbox from EA 7.5 to 9.0 soon.
So if anybody could help or might have some tips of how to efficiently search the forum.

Thank you in advance!

Frank

4
So in conclusion, there is hope  ;) - as usually is with EA
Thank you qwerty for the reply and the sparx guys for "picking" it up!

fginfrance

5
Hi,

I am trying to manipulate the default name of the instance of a stereotyped class from a profile.

For that I use the EA_OnPostNewElement() hook to change element.Name.
To avoid the opening of the standard property dialog, I put
rep.SuppressEADialogs = True
as indicated in the help.
Now the problem is that the hook is executed after the property dialog has been shown, so I see the change appearing too late.
Is this an EA bug, do I miss something or is it a problem of my python com client? Anyone could provide a working example in C# to compare?

I add the sample code (python, but straightforward to read):
Code: [Select]
 def EA_OnPostNewElement( self, eaRep, eaInfos ):
    msgbox( 'entry' )            # here the property dialog has already been opened & closed
    rep = win32com.client.Dispatch( eaRep )  # transforms IDispatch into python object
    if rep.SuppressEADialogs:
      msgbox( 'Ea2 off' )        
    else:
      msgbox( 'Ea2 on' )                     # here MsgBox shows Ea2 on

    rep.SuppressEADialogs = True        
    if rep.SuppressEADialogs:
      msgbox( 'Ea3 off' )                    # here MsgBox shows Ea3 off, so in principle changing the variable worked
    else:
      msgbox( 'Ea3 on' )                                      
    return True

Thank you in advance,
fginfrance

6
Hi KP,

thanks for the hint.
Will do as proposed.

Best regards
fginfrance

7
Hi,

I am starting with profiles, shape scripts and stereotypes.
I have managed to create 2 stereotypes on "Class" type (lets call them 'A' and 'B' ) and 1 for a connector..
Now I am looking for a way to restrict the usage of my connector in a way, that only connections of form 'A' --> 'B' are allowed.
'B' --> 'A', 'B'-->'B' or 'A' --> 'A' would be illegal and ideally generate a warning (as the standard Msgbox which tells that a link is not valid UML).
I supposed it would be somewhere in the use of 'Constraints', but could not find the solution.
Can anybody give me a hint?
Thank you in advance!

fginfrance


8
Automation Interface, Add-Ins and Tools / Re: Requirement management
« on: December 04, 2009, 10:59:36 am »
Hi,

The 2 reasons why we decided to use the RaQuest plug-in:

- good .CSV import/output interface which allows us to smoothly integrate the requirement management in the EA model with external tools

- RaQuest allows traceability of the revision evolution of each requirement (change log) which is mandatory for us (this might be a feature you could also get with the "Audit" funcyion of EA Corporate, but we don't use that one)

Regards
fginfrance

9
Automation Interface, Add-Ins and Tools / Automation Interface
« on: November 14, 2009, 01:01:13 am »
Hi,

I would like to follow-up on a discussion here http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1257343950/4#4 about the EA API speed.

I by coincidence observed that - while it is still slow  :( -  my app, which crawls a > 5000 element model completely to do some architecture rule validations, speeds-up significantly  ( * 5-10) when I open any modal Dialogbox in the EAUI in parallel.

Has anybody observed the same and has an idea if this is linked to Windows or EA? Could this be exploited programmatically?

(Current config is python + a local .EAP)

Regards
fginfrance

10
Hermes wrote on Nov 6th, 2009, 9:10pm
Quote
- custom listing of requirements:
...............................
I need a sort of view that lists requirements showing some selected set of taggedvalues...
can I create it as an user view (without coding & reinventing the weel)?
eventually could it be possible to call that by the add-in?
Not sure it is an option for you, but did you have a look at the RaQuest plug-in http://www.raquest.com?
I am also working on some impact-analysis tools and came to the conclusion that - far from being perfect - RaQuest adds some interesting bits of features around the Requirements management, which are "worth the money" - and no, I am not a share holder  ;)
So I use it on top of EA and just focus on the 'non-interactive' analysis scripts via the API.

From what I understood in your post, it could match to your needs for specific Tags (via User Def Attributes), filtered list views and dependency matrix.
It has the usual "30 days free" option, so you might consider to have a look...

fginfrance

11
Hi Geert,

It is friendly experts like you who make this forum a pleasure to participate to!
Thanks for the confirmation about 5 PDATA elements, it reassures me in using my python wrapper.
... and if I ever looked for a reason to "invest" in MS ACCESS, you gave me one  ;)
In the meantime, I will probably try to dump the XML of the element "on the fly"...
 
Regards
fginfrance

12
Hello Geert,

thank you for your answer.
I indeed try to dump systematically PDATA via the MiscData API for all elements w/ a little tool, since this was the answer to a previous problem (template infos) I posted, but not this time.
At least not in the 5 PDATA I am able to dump per elem before an execption is raised.
Btw. I have no experience w/ a C# access as I use a python wrapper, are you able to read beyond PDATA5?
Anyway, seems this Trigger/Spec entry is a hard one.
I checked also the XMI output and even there the Spec info is stored in a quite strange way (with a specific "signal" key and an inconsistent idref?!)

Will try to shift the infos from Spec to a more easily accessible field in the existing models, I guess...

Thanks again,
fginfrance

13
Hi,

I try to exploit an existing model where required infos have been put into the  Transition Properties/Constraints/Trigger/Specification: dialog fields

These fields are obviously related to the Notes (at least that is what opens in the context-sensitive help) and associated w/ the trigger (as they are globally updated wherever the trigger is used), but I cannot figure out how to read them from the API.

Any help would be welcome. Thank you in advance.

fginfrance

14
Dear umesan,

thank you very much for your willingness to share these undocumented info.
I will give it a try, being aware that the data might move away in a future version.

Regards
fginfrance

15
Automation Interface, Add-Ins and Tools / RaQuest Automation interface
« on: October 03, 2009, 08:37:28 am »
Hi,

is the RaQuest plug-in extending the EA automation interface in a way that it is possible to exploit the extended requirement properties introduced by RaQuest?

Specifically I am looking for a way to read out the Update Log infos.

Thank you in advance for any hint!
fginfrance

Pages: [1] 2