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 - vsantos01

Pages: [1]
1
I am developing a C# tool that opens eap/eapx/qea/qeax files as databases and allows launching queries to it. I am using a standard database connection using the connection string $"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={inputFile};" where inputFile is the variable containing the full path to the file to open.

I'm not sure if this will work for your accdb case, but maybe it's worth trying?

2
Hi all

I have created a support tool in C# which opens the EA file as a database and launches SQL queries to it. One of the things I'm doing is getting the URI property from Packages. Some of these URIs can be really long... so long that, although it is being stored in the EA file, the returned value from the SQL query is truncated. My parser of the obtained value fails because of unexpected format (missing closing delimiters and so).

Is there any known limitation on the amount of data returned from SQL query?

The field I am reading is Description from the t_xref table. Example of returned value: @PROP=@NAME=URI@ENDNAME;@TYPE=String@ENDTYPE;@VALU=uriofpackagea@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;

I am using eap files, meaning Microsoft.Jet.OLEDB.4.0 data provider.

Other queries work just fine.

Thanks,
Victor

3
Still an error, different, but an error. Anyway, I managed to do it by getting the GUID using PackageGUID instead of copy/pasting it:

Code: [Select]
EA.Package model = (EA.Package) repository.Models.GetAt(0);
EA.Package mainPackage = (EA.Package) model.Packages.GetAt(0);
string path = System.IO.Path.GetFullPath("Report.rtf");
repository.GetProjectInterface().RunReport(mainPackage.PackageGUID, "Standard Component Interface", path);

I have also checked that I can iterate through all the packages from the model , so instead of hardcoding getting the first one, I could search the needed one by name.

thanks for all your support!

4
I tried it, with the same outcome. I have uploaded a screenshot of the run report window I get when running the C# command supplied earlier. You will see the package is not being set.

https://imgur.com/a/H8WXEcS

5

Thanks again! This seems to be what I need. Unfortunately, still not working.

Code: [Select]
repository.GetProjectInterface().RunReport("{43C1B678-456B-487a-B852-9504E09BBAE4}", "Standard Component Interface", "Report.rtf");
This pops up a window with the error message "Error creating output file".

I have set the EA window in visible mode to debug, and I see how the Run Report window opens with all the expected data in the different configuration fields but for the package, which appears empty. I'm expecting this to be set by means of the first parameter of RunReport, which is defined as string named PackageGUID.

I got the GUID by manually opening the EA file and copying it from the package context menu (Copuy/Paste -> Copy Node GUID to Clipboard). I also added code to my console application to read it and print it on screen and I'm getting the same value as the one I'm using in RunReport.

Any ideas what can be failing here?

BTW, manually opening the Run Report window allows me to generate the report for the package selected in the package tree.

6
Hi Geert

Thanks, that was great and I'm experimenting already with it. But if I get it correctly, this interface is useful to build a document. I already have the document template, the style sheet, the table of contents style and so defined in my repository file... how can I just generate the document associated?

Rgds
Victor

7
Hi,

I'm starting to develop a C# console application to interact with my .eapx file. I'm at the very beggining and I have been able so far to open the file and get a reference to the model by using repo.Models.GetAt(0). The variable referring to this model, though, is of type object and thus does not have any field or method related to the model itself.

Code: [Select]
var repository = new EA.Repository();
repository.OpenFile("c:\tmp\myeap.eapx");
var model = repository.Models.GetAt(0);      // --> Here, model ends up being of "object" type

I have seen in the page https://sparxsystems.com/enterprise_architect_user_guide/14.0/automation/iteratethroughaneapfile.html that models contain elements such as the Name or the Packages, but if I try to use them, C# compiler complains as both Name and Packages are not properties of object type.

How can I access the data contained in a model?
Is there a place with the complete documentation of the Interop API and/or examples in C#?

Thanks!
Victor

8
I just started with interops to do just this: update dynamic section in custom document.
As a workaround, I could define a report and generate it... Any idea how to request report generation from c# starting from the EA.Repository object?

9
I made a test starting a new file from scratch and quickly adding a pacakge, a use case diagram, a custom template document... and everything worked as expected. I have no idea what was happening before. I believe the stylesheet was messing around somehow. Anyway, topic closed.

10
Hi

Yes, sure I'm using the correct one. Anyway, I created a custom stylesheet and now it works. I don't see the relation, so maybe something different happened under the hood. Maybe there was some kind of internal caching which got stuck until the new stylesheet was created. I will try to create a brand new file and try to reproduce it. Will be back with results.

Rgds
Victor

11

This is my first message on the forum, so hi everyone. I hope you can help me out here.

I'm trying to automate the creation of the documents needed to fulfill our development process and have the required workproducts extracted from the design data in EA rather than manually crafting them in word copy/pasting from the EA file. To do so, I've been messing around with Custom Document Templates, and I'm pretty happy with what I have accomplished so far. There's one thing, though, that's bugging me and I cannot see how to fix it, whcih is what the title pretty much says: I want the Diagram Notes to appear before the Diagram image in the generated document, but no matter what I do on the template that it stubbornly shows the image before the notes.

This is what I have on my template:

Code: [Select]
package >
{Pkg.Name}
{Pkg.Notes}
diagram >
{Diagram.Name}
{Diagram.Notes}
Following, the diagram detailing this:
{Diagram.DiagramImg}
< diagram
< package


As you can see, {Diagram.Notes} is placed before {Diagram.DiagramImg} and some text is manually added in between. But what I get is:


Code: [Select]
Following, the diagram detailing this:
{{ diagram image here }}
{{ diagram notes here }}


How can I solve this?


Thanks


Pages: [1]