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.

Topics - Bjorn S

Pages: [1]
I am using Sparx EA 13 build 1309.

I can run the HTML Report by doing EA.Repository->GetProjectInterface()->RunHTMLReport(...). Ditto for the pure RTF report, doing ...->RunReport(...). How would I go about getting the the "Diagrams Only Report" so I can generate the diagrams as PNG-files?

I suppose I can loop through the whole model and call a ...->GetProjectInterface()->PutDiagramImageToFile(...) for each diagram I find, but it certainly would be more convenient to just use the existing functionality.

The root problem here is of course that RunHTMLReport() doesn't generate image file names that are persistent across invocations (i.e. based on their GUIDs) like the "Diagrams Only Report" does. Missing a persistent way to address a diagram, it makes it impossible to refer to them from other documentation (e.g. a wiki).

Suggestions, ideas, ...?



Suggestions and Requests / Git version control support?
« on: March 19, 2012, 08:42:28 pm »
Hello, will Sparx add support for using Git for version control? Conceptually it shouldn't be much different from how Subversion has been integrated. Are there any such plans or roadmaps for this?



Automation Interface, Add-Ins and Tools / Generating WSDL from Javascript
« on: February 10, 2012, 05:15:40 am »
I have Javascript code that creates the WSDL structure (WSDL Namespace, Types, Messages, PortTypes, Bindings, Services) along with the accompanying WSDL element (stereotyped to WSDL) that holds the service definitions to create the WSDL file for. If I right-click the WSDL element in the menu and select "Generate WSDL..." and follow through the set of menus, EA creates the WSDL file just fine.

Now, how do I run the "Generate WSDL..." from within Javascript? This will enable me to fully automatically create the actual WSDL file(s) from a separate model structure.

And, of course, I'd be interested in hearing how I may run *any* of the menus from within Javascript. ;)



I am using EA 9.1, on Windows 7.

I created a scripting group of type "Project Browser" and added a few scripts. Those scripts show up as selections for the Project Browser script context menus, and run fine.

I wanted to export those as a MDG Technology to make it easier to share with others on the team - it's easier to import just one file instead of having to create a correctly named and typed group, create empty scripts and then copy & paste each script etc.

  • I created a MDG Technology file using Tools -> Generate MDG Technology File...
  • Clicked Next
  • Selected "Create a new MTS file" and clicked Next
  • Gave a good path and file name for the MTS file, clicked Next
  • Entered the Script Group as the "Technology", selected a good path and file name for the XMI file, gave an ID, Version and Note, and clicked Next
  • De-selected everything except "Scripts" and clicked Next
  • Selected the scripts I wanted to include from my script group and clicked Next
  • Clicked Finish

When I imported the MDG Technology I had just created (the XML), the scripting group was correctly created and named, and my scripts were all there. But, the group ended up with type "Normal" instead of "Project Browser", and thus my scripts were unavailable in the Project Browser. EA won't let me change the scripting group type for groups that were imported.

I have tried modifying the XML in both the XML and the MTS file so that the "type" attribute for each script element says "project browser" (also attempted with variations on capitalization, restarting EA between each attempt) instead of "normal". However, after reimporting (and importing into a fresh EA), the group still has type "normal" in EA and thus my scripts don't show up in the Project Browser.

Will modifying the "type" attribute help, and if so, what should I put in there to make the scripting group a Project Browser group?

Is this a bug in EA in that it doesn't get the correct group type right away? How may I get around it, if so?

Am I going about this wrongly? What is the recommended way to share a set of scripts, if not through a MDG Technology file, to avoid a bunch of copying and pasting? (The scripts are maintained separately in Subversion, as are the model packages .)  How may I make EA export the scripting group as  an MDG Technology file while keeping the group type intact upon import?

Any pointers and hints are appreciated.



Is it possible to access the EA functions that the EA menus refer to, from within JScript? Specifically I am looking for being able to call the Element -> Find in diagrams... function from within JScript. Any pointers to this and/or reference documentation for how to call other/any of the EA functions from within JScript is much appreciated.

Thank you,


I am using EA version 9, build 906.

Is there a documentation on the Javascript / JScript scripting available, and if so, where? I find that the object model described in the JDK doesn't always correspond to what EA works with or what the IDE in EA describes for the object. Say I select a package in the project that has several sub-packages, and run the following simple script:

---- 8< ----
!INC Local Scripts.EAConstants-JScript

var e = Repository.GetTreeSelectedObject();
Session.Output("elem type: " + e.ObjectType);

var pkg as EA.Package;
pkg = e;
Session.Output("pkg type: " + pkg.ObjectType);
var pkgs as EA.Collection;
pkgs = pkg.Packages;
Session.Output("pkgs type: " + pkgs.ObjectType);
var count = pkgs.Count;
Session.Output("count: " + count);
---- 8< ----

... I get the following output:

---- 8< ----
elem type: 5      
pkg type: 5      
pkgs type: 3      
---- 8< ----

I.e. execution stops at trying to get the Count from a Packages object - the type value of 5 is otPackage, 3 is otCollection - with no error message or other indication that something is wrong. How may I go about getting information about an element and it's child elements? I.e. where is a better and more complete documentation that the Enterprise Architect User Guide and the auto-complete suggestions from the EA Script IDE?



Pages: [1]