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

Pages: 1 2 [3] 4 5 ... 42
31
Hi,

I'm trying to find a way to run a script that will itself call the last script used.
Let's say that in the Package scripts, you have
- RunLast
- ScriptA
- ScriptB

If I run ScriptA, it will store this ref somewhere in EA.
Calling RunLast will retrieve the ref and run ScriptA...

The following does not seem to be feasible:
- have a dynamic include (!INC) on the script found from the ref
- call this script main function (e.g. OnProjectBrowserScript) when the group and script names are set as variables e.g. groupName.scriptName OnProjectBrowserScript

Do you know if there is a solution to achieve that?

Note: I thought of an option that would involve the following:
- rename each script's main function e.g. OnProjectBrowserScriptA, OnProjectBrowserScriptB, OnProjectBrowserScriptC
- include all scripts in the RunLast Script : !INC GroupA.ScriptA, : !INC GroupA.ScriptB, etc
- add a switch case in RunLast script that will call the function matching the ref e.g. ScriptA -> call OnProjectBrowserScriptA
-> unfortunately this doesn't work either since all my scripts have an option explicit which generates an error




32
Thanks for your replies. The tagged values store the definition of DB Views generated by EA via a DB Reserve.
So the full query is generated without any restriction on the number of chars.

It works ok if I use the API Object method as an alternative to queries (will use that..).


33
Hi,

In a VbScript, I set a local variable with the content from t_objectproperties.notes which I get by calling Repository.SQLQuery(SQL).
The script works well with a DBMS but not with an EAP: I figured out that the returned value is truncated after 255 chars.

Is this a known issue with EAP? Is there a workaround?

thanks

34
Here is a working solution in C#

1. create a Helper class:

Code: [Select]
using System.Runtime.InteropServices; //required for APIs
namespace myaddin....
{
    public static class WindowHelper
    {
        public static void BringProcessToFront()
        {
            Process proc = Process.GetCurrentProcess();
            IntPtr procHandle = proc.MainWindowHandle;
            if (IsIconic(procHandle))
            {
                ShowWindow(procHandle, SW_RESTORE);
            }
            SetForegroundWindow(procHandle);
        }

        const int SW_RESTORE = 9;

        [System.Runtime.InteropServices.DllImport("User32.dll")]
        private static extern bool SetForegroundWindow(IntPtr handle);
        [System.Runtime.InteropServices.DllImport("User32.dll")]
        private static extern bool ShowWindow(IntPtr handle, int nCmdShow);
        [System.Runtime.InteropServices.DllImport("User32.dll")]
        private static extern bool IsIconic(IntPtr handle);
    }
}

2. when EA screen needs to be restored, call the following:

Code: [Select]
        WindowHelper.BringProcessToFront();

35
Suggestions and Requests / Find Attribute type in Project Browser
« on: May 02, 2018, 06:56:53 pm »
It would be nice to have a Find Type in Project Browser for class attributes from a diagram or project browser to select the matching type in the browser.

36
Hi Adrian,

Thanks for your reply. I tried what you suggested in C# (using some infos from stackoverflow.com) and it's working :)
I need to consolidate it with all my forms, and should be able to provide a code sample if anyone comes across the same issue with C#.

cheers

37
Hi,

To improve usability in a future release of my add-in, I sometimes close an add-in popup window (C# form) to open another one.
So I have a class that runs Close() and Dispose() on the initial form object before creating another form (typically I open form1 from EA, form1 opens settingsform, and when settingsform is closed, the add-in determines that form1 needs to be closed and replaced with form2).
It works well, except that EA main screen/window sometimes gets hidden behind another application e.g. my web browser.

I tried to run repository.ShowWindow(1); but it doesn't do anything (BTW EA help doesn't say what value needs to be provided in ShowWindow to display or hide... even though I assume it's 1 & 0).

 

38
Having given it more thoughts and compared the "parents" tag + dependencies with the viewdef tag content, I may have identified a potential solution:
- parents tag lists all tables and views used by the view based on the FROM clause (incl. joins)
- dependencies match the tables and views involved in the SELECT clause i.e. at least one column appears in the view results/content


39
General Board / Reverse DB result: views dependencies & Parents tag
« on: April 27, 2018, 01:48:45 am »
Hi,

I ran a DB Reverse on a SQL Server that has tables and views.
I'm interested in the link between views and the data sources i.e. tables ; I understand this is stored in the parents tagged value with a comma-separated list of table names.

I couldn't find in the user guide what the dependency links from Views to Tables mean. Anyone has an idea?
Ideally I'd like to have links from views to the table sources which I can get via a script.


40
General Board / Re: Excel Import
« on: April 26, 2018, 01:19:18 am »
Hi Takeshi,

That's a really nice EA hint! I shall remember it.

Thanks,
Guillaume

42
Hi,

I can confirm that it works fine with the latest build.

Thanks,
Guillaume

43
Bugs and Issues / SQL Server Reverse on views: truncated definition
« on: April 20, 2018, 11:19:28 pm »
Hi,

I got the result of an EA reverse engineering run on a SQL Server DB that contains views. When the view definition (query) is longer than 4000 characters, the resulting definition in EA (viewdef tag memo) is truncated at this position.
I found a post on this issue here: http://www.sparxsystems.com/forums/smf/index.php/topic,10962.msg148710/topicseen.html#msg148710

Is there a way to resolve this in SQL Server, ODBC configuration or else?

Thanks

44
Automation Interface, Add-Ins and Tools / Re: Scripts submenus
« on: April 20, 2018, 07:20:11 pm »
Hi Aaron,

The easiest solution would involve using the existing groups in EA.

If you create Diagram Package Groups Group1, Group2, etc. then having an option in EA to treat groups as sub menus would solve the issue
So a right click on a diagram or package would display...
Group1
   Script 1
   Script 2
Group2
   Script 3
   Script 4

Instead of having a flat list ...
Script 1
Script 2
Script 3
Script 4

This issue is impacting quite a lot of users who have many scripts now.

45
It would be useful to add to the "Insert Related Elements" Connector types and Element types, a filter on Stereotypes e.g. to select "ABC" stereotyped classes that are associated with the current element.
It would also make sense to include the Stereotype on the Field chooser.


Pages: 1 2 [3] 4 5 ... 42