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 - jörg

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Unknown element in DiagramObjects
« on: December 17, 2020, 03:54:55 am »
Hi Specialists!

In my addin I'm facing a behaviour which I can't explain.

I'm iterating the DiagramObjects of a diagram and then for each DiagramObject I try to retrieve the related Element from the repository using the GetElementByID(ElementID)-Function of the Repository class to get further information about the element. The diagram is of course in the same repository.

This works very well for many diagrams but in one diagram the GetElementByID-Function throws an exception saying that it could not find the element ("Can't find matching ID"). The ObjectType is - of course - otDiagramObject and the GetType-Function of the DiagramObject class tells me it is a System_ComObject. The user (I don't have access to the EA project myself) searched the diagram and it's Elements and could not find any COM object. Re-saving the diagram (after a slight change) did not change anything. When he exports the package and imports it into a new project, the error is gone.

So I have the following questions (and hope for answers 8)):
1. Can anyone explain this behaviour?
2. How can I find out which element is causing the error?
3. Why is the error persistant over re-saving but disappears after exporting and re-importing into another project?

Question 2 is the most important one which I need an answer for. The others are for my curiosity

Thanks in advance,

Jörg

2
Hi all,

some days ago I discovered a very strange (IMHO) behaviour in EA:
When I delete elements from the project browser, which are placed in a diagram, the element disappears from the diagram (so far so good) but the modified date of the diagram has not changed although the diagram is changed.
This brings huge problems for me. I must detect, whether a diagram has changed since a special date and so I can't achieve this only by comparing the dates.

Can someone explain this behaviour to me?

Maybe there is also one who knows how to update the modified date in this case. Currently I check for changes by calculation MD5 checksums for the generated diagram pictures, which is very time consuming.

Thanks and Greetings,

Jörg

P.S.: I'm writing an AddIn but I decided to write here because this behaviour for me is a bug.

3
Hi all,

after many hours of trying and searching I don't see another way than to ask the specialists here. It is not my first EA-Addin I develop but I fail in creating a Tagged Value for a Package. This is my code:

Code: [Select]
            string error;
            bool updated;

            EA.Package internalPackage = repo.GetPackageByGuid(packageGUID);

            EA.TaggedValue taggedValueConfig = internalPackage.Element.TaggedValues.AddNew("tvname", "Memo");

            taggedValueConfig.Notes = "some notes text";
            taggedValueConfig.Value = "some value text";

            updated = internalPackage.Element.Update();
            if (!updated) error = internalPackage.Element.GetLastError();

            internalPackage.Element.TaggedValues.Refresh();

            updated = internalPackage.Update();
            if (!updated) error = internalPackage.Element.GetLastError();

AddNew gives me a valid tagged value object. Nowhere an error is shown. 'updated' is always true. But at the end the tagged value is not added to the collection.

On one hand the API documentation writes, that the 'TaggedValue' collection of the 'Element' class is readonly, which would explain the failed adding. Also the documentation for the 'Element' attribute of the package class says:
Quote
Element

Notes: Read only

The associated element object; use to get/set common information such as Stereotype, Complexity, Alias, Author, Constraints, Tagged Values and Scenarios.
So it states it is readonly but then it says it is used to get/set - amonst others - tagged values.

On the other hand I find many examples in the web for adding tagged values to elements (even in Ea-Documents, e.g. see https://sparxsystems.com/resources/user-guides/14.0/automation/automation.pdf, page 298), 'AddNew' returns a valid tagged value object and throws no exception and I can't imagine any reason why the 'TaggedValue' collection of the 'Element' class should be readonly.

I think there must be a way to add new tagged values to a package element. So please help me and tell me, what I'm doing wrong. I'm helpless and maximum confused. I know, it's a lot of text, but I wanted to give as much information as possible.

I use EA14 on a Windows 10 machine and I'm programming with Microsoft Visual Studio Professional 2019.

Thanks in advance,
Jörg

4
Automation Interface, Add-Ins and Tools / MDG Diagram derivation
« on: January 30, 2020, 04:37:13 am »
After a long time I'm back to EA and want to create an own MDG. There I have huge problems with creating own diagrams:

1. I tried to derive a diagram from a SysML1.4 diagram (SysML1.4::Sequence). In my diagram profile diagram I added a stereotype with name "SysML1.4::Sequence", another stereotype with my diagram name and an extension connector. In the base stereotype (SysML1.4::Sequence) i set the properties alias and toolbox (with an own toolbox in my MDG). When I (after creating and importing the MDG) want to add the diagram to a package, I can see the diagram in the selection dialog, but it doesn't have the icon of the SysML diagram but a class diagram icon. When I create the diagram, an empty diagram canvas is shown without any SysML frame and no metaclass.
I also tried  to change the base stereotype into a metaclass, with the same result except that the metaclass of the crated (derived) diagram is my derived diagram class itself.

2. So I changed the way to do it and derived my diagram from Diagram_Sequence metaclass. Now the icon was right, but the diagram itself still has no frame (diagramID set to 'sd', frameString set to '#DGMNAME#').

So my question(s): How can I derive a diagram from SysML1.4::Sequence or, if that isn't possible, how can I show the SysML frame around my diagram derived from 'Diagram_Sequence'?

Any help will be welcome!

5
Suggestions and Requests / Status property and tagged values for diagrams
« on: October 09, 2018, 07:30:47 pm »
For using diagrams in requirements engineering, it is needed to have at least a status property and tagged values in diagrams, as they are available in elements.
Maybe is should be possible to add an element reference to a diagram as packages have it (EA.Package.Element). In my opinion this can solve the problem since all element properties will be available to a diagram too, then and it should be able to do that without a database change (adding diagram to the t_object table).

Maybe there are more requirements engineers that have an opinion about that theme?

6
General Board / Status property of diagrams
« on: October 09, 2018, 03:16:14 am »
Hi all!
Why don't have diagrams a status property like elements and packages have? Or if the have it, why can't I see it in the properties dialog?

I'd appreciate any help, thanks!

7
General Board / Change values in workflow script
« on: September 06, 2018, 02:20:04 am »
As said in the title I would like to change item values in a workflow script. More exactly, I want to automatically increase the version of a requirement if a specific user (or a member of a specific group) changes the status to 'Approved'.

Unfortunately I seem not to have access to any repository items (Repository object) in a workflow script. I managed to change the Version of the current selected element in a script in the 'Normal' group by calling the script in the scripting console.
When I include the script in my workflow script, it tells me (in the System Output window) that the variable 'Reposotory' is not defined.
Even if I try to call it using the App-object (GetObject(,"EA.App") and get App.Repository object; I know it is marked as read only) just makes the Application freeze for a while and finally doesn't change the version but gives a message:
Quote
Timeout invoking script   
AllowStatusUpdate("Implemented","Mandatory")   

Is there any way to achieve my goal?

8
General Board / workflow script not called
« on: September 04, 2018, 10:24:06 pm »
First, Hi to all here in the Forum!

I'm pretty new to EA Scripting and I want to edit the workflow script. I created a new workflow script set the return value of AllowStatusUpdate to false. Nevertheless the status is changed. I added some output to the functions (Session.Output) but nothing appears in the system output window. It just seems not to call the functions. Same happens with the other functions (chenge version, phase, ...)


I'm really helpless in this point. Can anybody tell me what I do wrong here? I would really appreciate any help.

Pages: [1]