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 - Albert De La Fuente

Pages: [1]
1
Oh I didn't thought of that detail :o... It makes a lot of sense! Thanks!!

Actually I'm compiling on a linux machine (64bits) and running it on a VM (32bits) over ssh (Cygwin), since is a terminal app and debugging is easier. I thought about compiling over lan or crosscompiling but I couldn't do that yet...

Actually everything would be much easier if Sparx would support officially a native version of EA but they don't so I have to do those magic tricks.

Thanks for your answer, very helpful! =)

2
Hi,

I'm trying to build a program that iterates trough all the packages, elements and diagrams using Java EA API.

I found some python code that does something similar, ideally I would like to translate that code to Java but I'm not able to find some properties. Here are some Python snippets that I need to run on Java.

def DumpRepository(Earepository):
   print "-- Repostitory  --"
   print "Instance GUID: ", Earepository.InstanceGUID
   print "ConnectionString: ", Earepository.ConnectionString
   print "Library version: ", Earepository.LibraryVersion
   print
   print "Model count: ", Earepository.Models.Count
   print "Terms count: ", Earepository.Terms.Count
   print "Issues count: ", Earepository.Issues.Count
   print "Author count: ", Earepository.Authors.Count
   print "Client count: ", Earepository.Clients.Count
   print "Task count: ", Earepository.Tasks.Count
   print "Datatypes count: ", Earepository.Datatypes.Count
   print "Recource count: ", Earepository.Resources.Count
   print "Stereotype count: ", Earepository.Stereotypes.Count
   print "PropertyType count: ", Earepository.PropertyTypes.Count
   print

def expand_diags(diagrams, indent):
   for i in xrange(0, diagrams.Count):
        diagram = diagrams.GetAt(i)              
        print ("  " * indent) + "Diagram ID: " + `diagram.DiagramID` + "\t" + diagram.Name    
        
def expand_elems(elements, indent):
   for i in xrange(0, elements.Count):
        element = elements.GetAt(i)
        print ("  " * indent) + "Element ID: " + `element.ElementID` + "\t" + element.Name      
        
def expand_pkgs(packages, indent):
   for i in xrange(0, packages.Count):
        package = packages.GetAt(i)
        if 'p' in opts:
            print ("  " * indent) + "Package ID: " + `package.PackageID` + "\t" + package.Name
        if 'd' in opts:  
            expand_diags(package.Diagrams, indent + 1)
        if 'e' in opts:
            expand_elems(package.Elements, indent + 1)
      
        innerpkg = package.Packages
        if innerpkg.Count > 0:
            expand_pkgs(innerpkg, indent + 1)

Does anyone can please help me with something similar? I couldn't find similar examples on Java. I'm running this code and I always get NullPointerException:

    public void run (String[] args) throws Exception
    {
        inputFile = "C:\\EA\\siga.EAP";
                
        org.sparx.Repository r = new org.sparx.Repository();
        r.OpenFile(inputFile);
        
        out.println("-- Repostitory --");
        out.println("Models Count: " + r.GetModels().GetCount());

Thanks a lot for your help.

3
Thanks a lot Geert,

I will try that!

4
Thanks Geert,

I will research more about the dll to make it work.

Do you know what would be the routine to invoke to import a "Realisation" (or other) relationship?

Thanks again!

5
Thanks for your answer Geert,

I downloaded the xls file and open up the macro definitions, but I'm not able to execute it, I get the following error on EA.repository: “Can't find Project or Library”. I'm using EA & excel through wine emulation on linux

Is there something similar in Java? (i.e. Java cvs classes importer). At this point what I would like to know is how to import a relation between two or more objects, could you please highlight me where is that on your code? (line number)

Thanks again!

6
Hi,

I have a huge requirements list in excel that I'm able to import (csv) fine on EA. For each requirement, I want to create an use case, so I transform the file by changint the object type and I'm able to import (csv) it fine too.

Now what I would like is to import a single (1x1) relation between each use case and each requirement. UC01 <-> REQ01, UC02 <-> REQ02, and so on.

I have not found any "Realisation" object type or similar on the csv file so that it can be imported automatically. Is there any way to do this?

So what I thought is... Export (csv) both the use cases and the requirements with full UUID's to separated files, and them relate the UUID's of each in a new file that later will be processed by a python script to generate a xmi file so it can be re-imported to EA.

This approach is not very easy, so I'm looking for something more simple, if possible via csv.

Any ideas?

Thanks a lot!

7
Hi,

I'm quite new to EA and it's API.

I'm working in a quite big project that has several teams involved, and we would like to generate on a daily basis the updated documentation in both RTF and HTML format and publish it on our internal systems.

What I thought is to generate several RTF templates for each report type we want, and after do something like:

      public static void main(String[] args) {
            // TODO Auto-generated method stub
            String guid, out;
            org.sparx.Repository r = new org.sparx.Repository();
            
            System.out.println("Repository: " + args[0]);
            System.out.println("Package:    " + args[1]);
            System.out.println("Output:     " + args[2]);
            r.OpenFile(args[0]);
          
            guid = r.GetProjectInterface().GUIDtoXML(args[1]);


             r.GetProjectInterface().RunReport(guid, "default-requirements", args[2]);
             r.CloseFile();
      }

My doubt comes with the second parameter or RunReport, is it an internal EAP report, or an external one (Ex: C:\EA-reports\test.rtf). Perhaps this is a really basic question but I couldn't find anything about it nor examples, so any help would be appreciated.

Is it possible to do so using external reports? The idea is to use different templates through the command line (args[3])

Thanks a lot

Pages: [1]