Recent Posts

Pages: [1] 2 3 ... 10
1
Hello Everyone,

I have created and modified the add-in from http://blog.sparxsystems.eu/2015/06/do-you-miss-something-in-ea's-code-generator/ in order to solve the problem when calling an operation of a class which is outside the current package.

The message from the code template is "Associated behavior not found within the package!!" , I am sure you have already seen it  ;)

If I move this package to the same package than my calling class, it works perfectly.



So basically, I have reversed engineer the mscorlib.dll from microsoft inside a package called "framework" , so that I can access the .net framework inside EA.

I have another package called "system" with a class and an operation defined by a behaviour which interact with the class system.console from .net framework.

I want to call the operation WriteLine("") , but it complains that it can not find it within the package. If I nest the "framework" package under "system", everything is perfect it ends up with Console.WriteLine("Hello");

So what I have done so far: I have modified the C# code template "Action Call" and replace the section:
Code: [Select]
%if $sBehName == ""%
/*Warning: $sActionName - Associated behavior not found within the package!!*/
%endTemplate%

with
Code: [Select]
%if $sBehName == ""%
$sBehName = %EXEC_ADD_IN("EA_DCGB_ADDIN", "MyEASL_GET", "element", $GUID, "Name")%
%endIf%

Using visual studio and the debugger, I succeeded to find a matching object with same GUID, it is an object of type "Connector". The problem is now that I can not find any way to reach its operation to return its name.... and I am not even sure I should do this.

By using Bellekens Enterprise Architect Toolpack at https://bellekens.com/product/bellekens-enterprise-architect-toolpack/ , when I perform a search by GUID it finds the connector and the matching operation. But I don't succeed.

If someone has found how to do it I would really appreciate to receive a hint or a solution because I am a bit confused with the SDK, how the EA objects are constructed and how the behaviours are interpreted by the code generator.

Many Thanks,
2
Use SQL to do quick lookups.

Thanks, got the Repository.SQLQuery working (fetched an Element "Object_ID" from t_object)

Besides the XML result from SQLQuery, I also tried assigning the result  to a collection, like so:

Code: [Select]
Dim coll
Set coll = GetElementSet(sql, 1)

... but I don't know how I can make use of this result since the resulting single collection item seems to be an object reference(?). I'm obviously not getting how to use VBScript collections since id =  Coll(0) doesn't return the ID. :-[ ... 

// Rolf
3
General Board / How do I model this .NET Function?
« Last post by RIL on Today at 05:43:21 am »
Being new to .NET I have not learned how to represent the following code construct in UML, therefore, how do I model this function in EA?

VB.NET:

Code: [Select]
Public Function SetEnumValue(Of T As {Structure, New, IConvertible}) (
key As String,
enumValue As T
) As Boolean

The same as C#.NET:

Code: [Select]
public bool SetEnumValue<T>(
string key,
T enumValue
)
where T : struct, new(), IConvertible


// Rolf
5
General Board / Synchronize profile API
« Last post by tzafrir on Today at 04:01:27 am »
Hi,

Is there a way to synchronize stereotypes from a profile.
In EA there is a command "Synchronize StereoType", I want to activate the same command using my addIn.

Thanks
6
Automation Interface, Add-Ins and Tools / Re: Hide stereotype notation
« Last post by qwerty on March 25, 2017, 03:04:14 am »
The only way (I know) would be to change the diagram properties and uncheck Element/Stereotype. But that hides all stereotypes.

q.
7
Hi guys,

I'm modeling and analyzing component architectures with a custom profile + add-in. The syntax and semantics are pretty close to SysML and therefore I'd like to have an arbitrary number of diagrams (like Internal Block Diagrams) per component. As far as I understand, EA's SysML extension derives the association of a diagram to a block only through the implicit containment in the project browser, i.e. when I move the diagram somewhere different in the model, the "formal" relation gets lost.

This is exactly the problem I'm trying to solve. The possibilities I thought about are:
1. Introduce a reference list tagged value to the component that is manually maintained in the add-in.
2. If a list of associated diagrams should be retrieved, search through the diagram elements of existing diagrams and take the ones, where the component is used largest element containing its realization.

In the past, we used Option 1 in similar use cases, but it proved to be a pain in the ass to maintain tagged value lists of GUIDs manually during deletion and creation. In addition, reuse model parts in different projects is pretty hard, because the GUIDs get outdated quickly in that case.
Option 2 is again implicit and not very robust.

Does anyone of you have a better idea, how this could be solved? The ideal solution would be a connector between an element and a diagram, but that is not possible as far as i know.

Thanks for any insight!
Jan
8
Automation Interface, Add-Ins and Tools / Hide stereotype notation
« Last post by MatthiasVDE on March 25, 2017, 01:44:29 am »
When you create an mdg with uml profiles, and you don't use shapescripts, how can you prevent that the stereotype appears on your diagram?
9
You don't need an SQL query for that (by the way you are querying the wrong table) you can use .start and .end bookmarks in your template to hide section in case a certain field is not filled in.

There is some explanation in the help about that.

Geert
10
Use SQL to do quick lookups.

Geert
Pages: [1] 2 3 ... 10