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

Pages: [1] 2 3 4
1
General Board / Re: Connector Properties
« on: September 10, 2024, 10:05:57 pm »
Thanks, Geert.  I was able to access Properties that way. And, you were correct in indicating that the info is quite carefully hidden in plain sight in the manual.:)

2
General Board / Re: Connector Properties
« on: September 10, 2024, 12:46:48 am »
Here it is:

function dumpConnectorInfo() {
                var elem                                                                              as EA.Element;
                var conn                                                                              as EA.Connector;
                var selectedObjects                                     as EA.Collection;
                var diagObj                                                                        as EA.DiagramObject;
                var conns                                                                            as EA.Collection;
                var diag                                                                                as EA.Diagram;
                var props                                                                             as EA.Properties;           // <--- no such EA element exists
                var prop                                                                               as EA.Property;                               // <-- no such EA element exists
               
                Repository.EnsureOutputVisible("Script");//opens the output window
                Repository.ClearOutput("Script"); // clears the output window
               
                diag                                                                                       = Repository.GetCurrentDiagram();
                selectedObjects = diag.SelectedObjects();
                if(selectedObjects.Count > 0) {
                                for(var i = 0; i < selectedObjects.Count; i++) {
                                                diagObj                                                                                               = selectedObjects.GetAt(i);
                                                elem                                                                                     = Repository.getElementByID(diagObj.ElementID);
                                                conns                                                                                   = elem.Connectors;
                                                if(conns.Count > 0) {
                                                                for(var j = 0; j < conns.Count; j++) {
                                                                                conn                                                     = conns.GetAt(j);
                                                                                Session.Output("conn name " + conn.Name );
                                                                                Session.Output("   objType " + conn.ObjectType );
                                                                                Session.Output("   stereo " + conn.Stereotype );
                                                                                Session.Output("   metaType " + conn.MetaType );
                                                                                conn.Properties;
                                                                                if(conn.Properties.Count > 0) {                                                // this does exist
                                                                                                for(var k = 0; k < conn.Properties.Count; k++) {
                                                                                                                Session.Output(" prop name " + conn.Properties.Name);  // << this breaks also
                                                                                                }
                                                                                }
                                                                }
                                                }
                                }
                }
                Session.Output("Done.");
}                                                                             


3
General Board / Re: Class operation parameter types
« on: September 09, 2024, 10:09:10 pm »
I have asked support about it. 

4
General Board / Re: Connector Properties
« on: September 09, 2024, 10:05:45 pm »
It's possible that in VBScript, EA.Properties exists.  In JScript, it doesn't.  I can see conn.Properties within JScript, but cannot access it.  In fact, it appears to have the same attributes as an EA.Element when I use JScript's autofill.  I will also reiterate that in JScript, there's no EA.Property that I can map one of the conn.Properties to.  And yes, I've seen both Properties and Property in the manual.  I just can't extract anything from them.

5
General Board / Template Bindings
« on: September 07, 2024, 02:47:16 am »
How can I express multiplicity in an actual bound template element?   I have a template, MyClass<T> and want to map it to MyActualClass<OtherClass[]>.  I haven't been able to figure out how to set the multiplicity of the actual template parameter, OtherClass.

6
General Board / Re: Class operation parameter types
« on: September 07, 2024, 12:38:28 am »
I was getting something for the TypeInfoProperties collection in JScript.
param TypeInfoProperty Name : direction
param TypeInfoProperty Value: in
param TypeInfoProperty Name : effect
param TypeInfoProperty Value:
param TypeInfoProperty Name : isException
param TypeInfoProperty Value: false
param TypeInfoProperty Name : lowerValue
param TypeInfoProperty Value: undefined
param TypeInfoProperty Name : name
param TypeInfoProperty Value: undefined
param TypeInfoProperty Name : isOrdered
param TypeInfoProperty Value: false
param TypeInfoProperty Name : isStream
param TypeInfoProperty Value: false
param TypeInfoProperty Name : type
param TypeInfoProperty Value: undefined
param TypeInfoProperty Name : isUnique
param TypeInfoProperty Value: true
param TypeInfoProperty Name : upperValue
param TypeInfoProperty Value: undefined
param TypeInfoProperty Name : visibility
param TypeInfoProperty Value: undefined

Note that except for the booleans, direction, and effect, the other values are undefined, which is strange.

7
General Board / Re: Connector Properties
« on: September 07, 2024, 12:11:55 am »
in jscript (and I assume in vbscript as well), I can create a declaration "var coll as EA.Collection;", which is an array with methods, one of which is "coll.GetAt()", which will return an element of that collection (I'm sure you know all of this).  My issue is that while the connector (i.e., EA.Connector) has an element called "Properties", which appears to be a collection, as I can retrieve properties.Count. However, I've not found what element it is a collection of.  In your second link, there's a Property class.  In jscript, I can't create a 'Property' using "var prop as EA.Property".  EA.Property doesn't appear to exist.

8
General Board / Re: Connector Properties
« on: September 06, 2024, 10:58:57 pm »
THanks, Geert.  I found that information.  My issue is that while the EA.Connector has a Properties attribute, which I assume is an EA.Collection, I haven't been able to find an EA.xxxxx that each item in the collection maps to.  There's no EA.Property.

9
General Board / Connector Properties
« on: September 06, 2024, 10:12:47 pm »
in the EA.Connector type, there's an attribute, Properties.  I'm assuming it's a collection, but have not been able to map it to a specific EA element  (there's no EA.Property that I can see).  TIA for any help.

10
General Board / Re: Class operation parameter types
« on: September 06, 2024, 09:09:08 pm »
If it were for me, I wouldn't worry about using an undocumented feature.  However, I can't chance blowing up the model we have.  There has to be a way to do this using parameter attributes.

11
General Board / Re: Class operation parameter types
« on: September 05, 2024, 10:27:58 pm »
Appreciate the replies.  I've seen the t_xref output.  I'm trying to determine how to  modify this information in a script (jscript preferable, but I can probably determine the equivalent from a vbScript).  I'm concentrating on the TypeInfoProperties class, as parameter appears to hold the lowerBound and upperBound info there.  I've tried to output in a jscript, but appear to be missing something.

12
General Board / Re: Class operation parameter types
« on: September 04, 2024, 09:27:08 pm »
This is what I've determined so far.  The info I need is hidden within parameter.TypeInfoProperties. Each element within is a TypeInfoProperty.  I've accessed so far by indexing through TypeInfoProperties.items(i). The issue is that while I can access the TypeInfoProperty.Name, not all of the TypeInfoProperty.Value values appear (the booleans do, as well as 'direction', but the others appear as undefined values).  Again, TIA.

13
General Board / Re: Class operation parameter types
« on: September 04, 2024, 03:05:18 am »
Agreed.  I can see the info in the t_xref table.  That said, I'm  trying to figure out how to access (or change) the same info in a jscript script.  Appreciate any help.  TIA.

14
General Board / Re: Class operation parameter types
« on: September 03, 2024, 10:11:26 pm »
I just got the answer from Sparx support.  I can't specify the cardinality (multiplicity) of a parameter in an operation.

15
General Board / Re: Class operation parameter types
« on: August 30, 2024, 05:16:27 am »
Is there anyone who can tell me how to add multiplicity to an operation parameter type?

Pages: [1] 2 3 4