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 - Slávek Rydval

Pages: [1] 2
1
I want to create ASP.NET Core 2.1 application with reading data from EA (I know that joining .NET Core with the Win32 world is not recommended). I create a web application from the template in Visual Studio 2017, add a reference to Interop.EA and in a controller is this code:

Code: [Select]
public IActionResult Index()
{
    EA.Repository r = new EA.Repository();
    r.OpenFile(@"c:\Temp\UCI.EAP");

    return View();
}

When creating a new instance, it fails with System.ExecutionEngineException exception (in data of the exception is {System.Collections.EmptyReadOnlyDictionaryInternal}). Do you have any idea how to fix it?

An instance of EA is in processes created.

2
Hello,

I've got ASP.NET Core 2.1 app that is accessing EA repository. The code below works fine until I want to create another instance. When I use the code again, the current instance of EA is used, so I lose the connection to the first repository. Is there any witted solution to this problem?

Code: [Select]
EA.App eaApp = (EA.App)Activator.CreateInstance(Type.GetTypeFromProgID("EA.App", true));
eaApp.Repository.OpenFile(_repository);
EA.Element test = eaApp.Repository.GetElementByGuid(_testGUID);

3
Hello,

I've got two add-ins that react on these events: EA_AddinLicenseValidate, EA_AddinLicenseGetDescription and EA_GetSharedAddinName. When I'm using just one of them, everything works fine. But when I enter the license key for the second add-in, it rewrites the first one's license key and vice versa. I can't see the reason why. It of course causes the situation when I cannot use both add-ins at the same time. Where could be a problem?

You can find a testing solution for VS 2017 at GitHub: https://github.com/SlavekRydval/LicensesInSparxEAAddins

Sparx EA 14 build 1420.

4
Bugs and Issues / EA_OnContextItemDoubleClicked
« on: May 04, 2018, 07:02:22 am »
I just reported this bug for the very last build of EA 14:

When an addin reacts on EA_OnContextItemDoubleClicked and returns true, a context menu appears.

1. just use some addin reaction on EA_OnContextItemDoubleClicked.
2. double click on an item in Project Browser and show e.g. a custom dialog.
3. Close the dialog.
4. return true from EA_OnContextItemDoubleClicked.
5. a context menu appears.

This content menu has the same items as the sub menu Properties in context menu of the item in project browser.

Is anyone experiencing this as well?

5
Next point.

The problem is in case there is File Based Keystore.

When I use Keystore Server (ssks://...), it works fine.

6
Yes, there is a prefix. I wouldn't be able to insert a licence into Key Store without the prefix.

7
I have practically the same code, here isn't the problem.

On startup the operations are called in this order:
  • EA_GetSharedAddinName (I return a string)
  • EA_AddinLicenseGetDescription (another string for cosmetic purposes)
  • [EA_AddinLicenseValidate (checking the licence validity, not called because the shared licence is not entered)]
  • EA_OnInitializeTechnologies (here I check whether licence exists or it is a trial)

Code: [Select]
private const string AddinName = "CaprCheekyEAJira";

public string EA_GetSharedAddinName(EA.Repository Repository)
     => AddinName;

public string EA_AddinLicenseGetDescription(EA.Repository Repository, string AddinKey)
    => AddinName == AddinKey ? "Cheeky EA Connector for Jira": null;

public bool EA_AddinLicenseValidate(EA.Repository Repository, string AddinKey)
{
    try
    {
        mainViewModel.Licence = new LicenceViewModel (new LicenceModelService().Read(AddinKey.Substring (1, AddinKey.Length-2)), new DialogService());
        return true;
    }
    catch
    {
        return false;
    }
}


8
Automation Interface, Add-Ins and Tools / How to use shared keys in add-in?
« on: February 22, 2018, 12:19:20 am »
I developed an add-in that uses EA licence abilities. Private keys work properly but shared have problems: I am always getting this error messages when trying to add a key via Add Registration Key in EA: The last key of this type has just been taken by someone else. That means (besides other) that EA_AddinLicenseValidate is not called.


https://www.dropbox.com/s/bru9tczuvn2xz0b/Key1.png?dl=0


https://www.dropbox.com/s/ikagz7gwbr9yupa/Key2.png?dl=0

When I check the licence in Sparx Systems Key Store, licence is not taken (assigned) to anyone so from user perspective is free.


https://www.dropbox.com/s/q66owf0ddxha1bq/Key3.png?dl=0

Where should I look for a solution?

9
Ok, cheers. I have to admin that there is wrong design of EA as many times before. :-(

For those who is interested in source code: https://github.com/SlavekRydval/GoatAssociations

10
Well, in case of using OwnedByClassifier the bahaviour is less predicable. I have this dialog and accept the side effects would be a pain in the ass:



So again, is there any description how to properly use ConnectorEnds?

11
I have a simple directed association between two classes. Then I change the c.ClientEnd.Navigable to "Non-Navigable" value within an addin method. As a side effect, EA changes connector's direction to the opposite one. Why?

The code in C#:


EA.Connector c = Repository.GetCurrentDiagram().SelectedConnector;
//now, the c.ClientEnd.Navigable == "Unspecified", c.SupplierEnd.Navigable == "Navigable" and c.Direction == "Source -> Destination"

c.ClientEnd.Navigable = "Non-Navigable";
//now, the c.ClientEnd.Navigable == "Non-Navigable", c.SupplierEnd.Navigable == "Navigable" and c.Direction == "Source -> Destination"

c.ClientEnd.Update();
//!!!now the value of c.Direction is "Destination->Source"!!!

c.Update();
Repository.SaveDiagram(Repository.GetCurrentDiagram().DiagramID);
Repository.ReloadDiagram(Repository.GetCurrentDiagram().DiagramID);


You get more side effects when you change OwnedByClassifier:

c.ClientEnd.OwnedByClassifier = true;
//direction and navigability is chagned


Is there any description how to proper change ConnectorEnds properties without these side effects?

12
Automation Interface, Add-Ins and Tools / Re: MDG_GetProperty and icon
« on: November 06, 2016, 03:51:26 am »
Ok, I got it. It seems that the DLL with the icon musn't be a .NET DLL. If I build Win32 DLL, it is working.

[modification]
As for the hidden menu items, it must be obviously return EA.MDGMenus.mgBuildProject | EA.MDGMenus.mgMerge | EA.MDGMenus.mgRun

13
Automation Interface, Add-Ins and Tools / Re: MDG_GetProperty and icon
« on: November 06, 2016, 01:37:55 am »
No reply so far, so I prepared minimal solution, maybe someone will try it: https://github.com/SlavekRydval/SparxEAMDGMinimal

14
Uml Process / Re: Information Flow vs. Dependency Relationship
« on: November 01, 2016, 10:24:25 pm »
You have to distinguish between UML standard and UML in EA. In UML standard has Dependency really nothing in common with Multiplicity. In comparison with UML standard, EA allows you to break many UML rules (constraint).

Dependency is not a relationship between Classifiers but NamedElements (thus you can have dependency e.g. between attributes). As UML states:

Quote
A Dependency implies that the semantics of the clients are not complete without the suppliers. The presence of Dependency relationships in a model does not have any runtime semantic implications. The semantics are all given in terms of the NamedElements that participate in the relationship, not in terms of their instances.

Dependency is a specialization of DirectedRelationship.

Association is a specialization of Relationship and Classifier. Association has any number of ownedEnds (of metatype Property) and specifies a relationship between instances of these properties.

In my own UML life I try to omit using pure dependency. There are specialization such as Using or Realization whose semantics is more concrete. If a class calls an operation in other class, I use Usage. On the other hand, if a class is in an association with other one (such as Person has BankAccount), I use Association.

15
Automation Interface, Add-Ins and Tools / MDG_GetProperty and icon
« on: November 01, 2016, 08:18:25 am »
Hi,

are there any rules related to the icon in dll with the plugin? I've got MDG plugin written in C# (.NET 4.5.2 or higher) and an icon as a resource. When a question to the icon comes I return:


public object MDG_GetProperty(EA.Repository Repository, string PackageGuid, string PropertyName)
{
    switch (PropertyName)
    {
        case "IconID": return System.Reflection.Assembly.GetExecutingAssembly().Location + "#treeview";
        case "Language": return null;
        case "HiddenMenus": return EA.MDGMenus.mgBuildProject & EA.MDGMenus.mgMerge & EA.MDGMenus.mgRun;
        default: return null;
    }
}


Although the package is connected, no icon is shown. Beside the icon I tried also a bitmap without any positive effect. Can you give me any hint? Cheers.

Pages: [1] 2