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

Pages: [1] 2 3
General Board / How do I model this .NET Function?
« on: March 26, 2017, 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?


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

Hi all,
(Edit: EA 12.1)
For some reason adding method parameters into new classes & methods fails consistently during (import from text file). When I look at the db tables (t_operationparams) I noticed that the parameters end up in the table, but no OperationID is ever assigned (or, the params  are not actually attached to the method it seems). Classes and Methods are successfully created though (at least they show up in the model treeview).

This code (with valid string data, see log text below)

Code: [Select]
Private Sub CreateSignature(ByRef aMethod, aSignatureString)
Dim ParamObj As EA.Parameter
''' blah blah
For i = 0 to UBound(arr)
''' Blah, blah
sType = EnsuredTypeName(sType)
Set ParamObj = aMethod.Parameters.AddNew(sName, sType)
''' Blah, blah
LogForced "----------------------------"
LogForced "Parameter Name: " + sName
LogForced "Parameter Type: " + sType
if ParamObj.Update() = False then _
LogForced "#### Error creating Parameter: " + ParamObj.Name
End Sub

... results in consistent errors, like so:

Code: [Select]
[410218891]      14:18:18: ----------------------------
[410218892]      14:18:18: Parameter Name: val
[410218892]      14:18:18: Parameter Type: System.Drawing.Font
[410218900]      14:18:18: #### Error creating Parameter: val
[410218922]      14:18:18: ----------------------------
[410218922]      14:18:18: Parameter Name: key
[410218923]      14:18:18: Parameter Type: String
[410218931]      14:18:18: #### Error creating Parameter: key
[410218936]      14:18:18: ----------------------------

Tables looking like this:

Not one single parameter (out of several hundred) is successfully added to any method. Any ideas about where to look for the problem?

Scratching head.

// Rolf

General Board / User Interface models to Html?
« on: August 26, 2016, 08:37:17 pm »
Hi all,
Is it possible to somehow export UI models to html?

I need do make a bunch of forms & dialogs to be used with RhinoScript that supports forms/dialogs only by loading html pages (calling Rhino.HtmlBox).  But I really really don't want to handcraft the html...

If EA isn't the tool for it, is there any other option out there that would be worth looking into?

// Rolf

Suggestions and Requests / Fully functional API for TaggedValues
« on: December 03, 2015, 03:45:00 am »
A number of problems with the lack of proper API access to Default Values defined as UML Types (table t_propertytypes) needs a proper API.

The problems involved is described in detail in this post (from the fifth post in the thread) :

Although not describing here all the problem involved, there's an absolute need for adding two attributes to TaggedValue with the following functionality:


- DefaultValue() would retrieve what we could call "overridden" Default Values, if any, from the table corresponding to its parents type ( "t_<element type>tag"). This value is the value defined as "initial value" of the TaggedValue names when entered as attribute members to Stereotypes in Profile models.

- If no value is present, it returns the Default Value as defined in the table [size=12]t_propertytypes[/size], or better, from the property GlobalDefaultValue().  The logical flow would be as follows :

''' TaggedValue.DefaultValue()
Function DefaultValue()
    DefaultValue = ""
      If ContainsStr(Notes, "Default:") Then
            DefaultValue = '// The value to the right of "Default:"
            DefaultValue = GlobalDefaultValue()
      End If
End Function[/size]

[size=12]''' TaggedValue.GlobalDefaultValue()
Function GlobalDefaultValue()
      GlobalDefaultValue = '// Retrieve from the table "t_propertytypes"
End Function[/size]

Now the existing Value() property could have the following implementation:

[size=12]''' TaggedValue.Value()
Function Value()
      ''' The pseudo property "_Value" here represents the internal storage
      if _Value <> "" Then
            Value = _Value
      ElseIf DefaultValue() <> "" then
            Value = DefaultValue()
      ElseIf GlobalDefaultValue() <> "" Then
            Value = GlobalDefaultValue()
            Value = ""
      End If
End Function[/size]

One could think of the approach as TaggedValues a sort of "polyphormism" for DefaultValues, sorts of, which in my case has proven being very very useful. This is when the same UML Types/TaggedValues are used in different contexts, i.e. in different Stereotypes.
Again, see a more detailed description of this workaround/feature in the linked post.

Hide complexity
The above functionality would hide the extra complexity due to TaggedValues having different ways of storing its info for different model element types, for example AssociationEnds, which needs to have the same support as any other group for TaggedValues (in my framework solutions the Role TVs are the most important, but they have the least support in EA).

Model Maintenance
The complexity of dealing with TaggedValues as EA API works today is a real problem, and when models or UML Types changes, updating the TaggedValues is, well a nightmare. I have no solution for that though, given how the values are stored today, which is an indicator of how this actually can become a showstopper for MDA Framework projects, which I'm into.

In my current (application Framework) model I have over 80 thousand Tagged Values to deal with (from Class, Attributes, Operations, Connections and ConnectionEnds). See the linked post for screenshots of the numbers involved.

Huge models, in turn, indicates that any solutions also needs to regard performance, since code generation from such a model is at risk of taking too long (maximum 1-2 minutes for a 250 classes model).

[edit]+Code Generation Template
Moreover, implementing this logic behind the Value() property would also bring the Code Generation Template system back to life, since it would suddenly start give access to the (default) values in TaggedValue system (given that the values of the [size=12]<element kind>Tag[/size]'s[/color] are actually read from the Value() property)[/edit]
Best regards,
// Rolf Lampa

General Board / Locating and relocating Connectors (in Packages)
« on: February 20, 2015, 05:14:02 am »
Hi all,

I drew a device with a composite diagram as Class diagram. Then I tried to move the Classes to another Package, but, it seems the Connectors (didn't move along, and they) don't seem to be able to be Located & Relocated (between packages).

I can find the Connectors by clicking on the classes, but the "owning" package doesn't seem to be able to list them, and, no option (that I could find) to move the Connectors to another Package of choice.

When I try to export the model (my own VBScript to JSON) the Connectors simply aren't in the Package structure (since the relations were drawn while all classes were located outside of the Package for the class structure).

Q: Is there any simple UI access to locating Connectors ("by Package") and any command for moving them to another package?

// Rolf Lampa

General Board / EA10 - Failed to initialize Javascript engine
« on: December 28, 2014, 02:45:43 am »
Hi all,

EA10 on Win7 Ulitmate.

I'm trying to debug a VBscript (not javascript) but I keep getting the following debug log:

[84269569]      Stack recording threshold set to 3 frames
[84269632]      Default Directory is C:\Windows\system32
[84269633]      Agent dll found: C:\Program Files (x86)\Sparx Systems\EA\VEA\SSScriptAgent.DLL
[84269633]      Default Directory is C:\Windows\system32
[84269633]      Agent: Started
[84269673]      Failed to initialize Javascript engine

So far I can only close the debugging session, nothing happens (no execution) and I can't step or anything, only close down the debugging session.

I also tried to turn off all script debuggers except for VBscript.

All the related dlls are located in the C:\Program Files (x86)\Sparx Systems\EA\VEA folder (6 dlls).

Shouldn't this work "Out of the box"?

// Rolf Lampa

General Board / Tagged Values for Roles?
« on: December 14, 2014, 08:59:22 am »
Hi all,
I have EA10 Ultimate which does not have TVs for Roles (which is a showstopper for my code generation, which needs to regard several additional properties for association roles).

Does any later version of EA introduced TVs for roles?

// Rolf Lampa

General Board / Preserve manual code on codegen
« on: July 26, 2013, 01:20:47 am »

I made my own code gen templates (= has no reverse enginering of code), and now I wonder:

Q: Is it possible to store the manual code (method bodies) in the model (when tested and fine) as to preserve the manually written code if need be to regenerate the class structure?

General Board / Default file extension for custom code templates?
« on: July 26, 2013, 01:40:18 am »
When I generate code using my own code template (custom language) I seem to have to manually set the file extension for all new classes / packages. Is this really needed? Am I missing some setting for the templates?

For inbuilt codegen languages this is not needed (as the extension can be set in a settings dialog for the languages).

General Board / CodeGen - ImportSection fail for new language
« on: July 25, 2013, 10:32:47 am »
Hi all,

I made a code generator template for Go based on Delphi, but for some reason the "Import Section" ("uses") doesn't seem to work for Go with the exact same template code as for Delphi.

Delphi generates this code for a given model:

uses MLStringIdentifier, Language, AmClass;

but nothing at all for Go. :(

Template code for Delphi is:
Code: [Select]
$imports = %fileImports%
$uses = %WRAP_LINES($imports, "50", "     ")%
%if $uses != ""%
uses %TRIM_LEFT($uses, "     ")%;\n

Template code for Go:
Code: [Select]
$imports = %fileImports%
$uses = %WRAP_LINES($imports, "50", "     ")%
%if $uses != ""%
import  ( %TRIM_LEFT($uses, "     ")% )\n

Any ideas? Is something in EA "hard coded" as to recognize dependencies only if Delphi language is set for classes, or what in the world can be the cause for EA (well, %fileImports%) not being aware of any dependencies in the Go-case?

// Rolf

General Board / UML + Simulation Models
« on: March 23, 2013, 08:11:05 am »
Hi all,

Something that I often stumble upon as a business consultant doing analysis (occassionally resulting in software design) is the lack of Simulation capability (including 2D and 3D graphics)  that can directly make use the info already gathered in UML diagrams (like State, Action & Class diagrams).

A tool like EA really should provide with that missing bit (simulation models) for deeper analysing of problem domains. Something like this:

EA 2.0 ? (see  ::) )

Different simulation model approaches are suitable for solving different problems.  Sometimes they all need to be combined capturing different parts of a complex system to be simulated.

A new field for Sparx to cover, or is there already some add-ins for some or all of this, or perhaps some external simulation tools which integrates well with EA?

// Rolf Lampa

General Board / Notes view inspector for each role
« on: February 06, 2009, 10:42:40 pm »

Evaluating EA, looking good!

The property inspectors have improved significantly since I tried EA last time. But unfortunately I couldn't enter text in the "object inspector's" Notes view for association roles (the notes view which is displayed is only for the entire association or for a note common for all names on the association).

Q: Is it possible to arrange so that the notes view for each role is always visible like the property inspectors?

I need this very much because I enter special notation in it which I later parse/interpret with an external tool after export. This also means that I need that the Notes view for a particular role show its content directly when I click on a role name on a diagram (Now I could access the role's Notes view only by opening up the associations properties dialog).  

Can I change settings somehow so that the Notes view behaves as desired?


// Rolf Lampa

General Board / Property inspector only for Class?
« on: August 02, 2006, 04:09:51 pm »
Hi all,

I'm evaluating EA, and find myself missing an (always) open property inspector view for attributes, operations and associations.  

Default desktop had an inspector for class properties open. Is it only me who don't know where to find and to activate a similar property inspector for the attribues as for the classes, or doesn't it exist?

I really hope that there's an inspector for the class members also...


// Rolf Lampa

Bugs and Issues / VBScript string match doesn't match (!)
« on: December 02, 2015, 04:35:38 am »
Hi all,

I have a problem with VBScript which has kept me occupied for more than six hours. When I compare two strings as to get a boolean result, I always get false even if the two strings are similar.

I read p from a TaggedValue, and the Local Variable window confirms that p holds the value "Persistent". When I compare (p = "Persistent") I expect to get True as the result (of course), but I get False, over and over and over again.

I tried renaming the variable, I tried to compare against a string constant, and as shown in the image below (notice how the variable p should make a perfect match against the string "Persistent", I also tried restarting EA, and restarting Windows, and... no go.

This drives me crazy.

Has anyone out there experienced something similar? Any ideas about what more to try (I think I tried very much already, including reshuffling code into smaller script files, etc, etc, but nothing seems to help).

This is getting spooky:

The program logic should follow the blue arrow, but it follows the red arrow, which indicates that the script interprets p <> "Persistent". <scratching head>

I make this check several times in the same method, but this error is consistent in all places. :(

// Rolf

Bugs and Issues / _tagGroups doesn't update in DB when changed
« on: November 25, 2015, 02:06:05 pm »

Bug in EA 12.1.1222 :

Description: Tagged Value Groups ([size=12]_tagGroups[/size][/font][/color]) in the meta model isn't updated properly if changed.
Reproduce: Modify the group names, or add, and later remove a trailing semicolon in the _tagGroups list of group names in the meta model, the correction isn't updated/refreshed also in the corresponding database field.
Effect: This affects the final listing and grouping of the Tagged Values in the UI (in my case the TVs wasn't grouped at all due to a traling semicolon, which obviously is interpreted as part of the group name, and thus it doesn't match the [size=12]_tagGroupings[/size]).
Expected result: The DB field should of course be updated to store only what the meta model specifies so that the UI can render/group the TVs properly.

The field holding the [size=12]_tagGroups[/size][/font][/color] definitions is located in the table t_xref.[Description]

Example of an annoying error I fought with for hours. A typo remained uncorrected in the DB although fixed in the meta model, and caused the model to not render or group the Tagged Values as expected (the red semicolon causing trouble was stuck in the field as shown below):

... so I had to manually edit the database field (via MSAccess) to get rid of that annoying semicolon, like so :

In short: You have a bug there. Updating the stereotype [size=12]metaclass._tagGroups[/size] in the meta model must be updated also in the database. I even tried to remove the _tagGroup from the UI meta model altogether, but no go, the string still remained in full, untouched in the field as depicted above, even if it should have been removed entirely.

// Rolf

Pages: [1] 2 3