Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Bex on April 03, 2008, 02:13:28 am
-
Hi All,
Does anyone know how to access the Parameter Values displayed on a message in an Object Sequence diagram? For example, Object1 sends a message (calls) Object2:Math.Add(P1: int;P2 : int) : int
In the Message Properties I can specify that the values are say 1 and 2 for P1 and P2.
I can get hold of the operation profile by using the Misc_Data (probably not recommended):
string md1 = theConnector.get_MiscData(1);
and also via the connector's properties:
EA.Properties prop = theConnector.Properties;
foreach (EA.Property thePropery in prop)
{
string name1 = thePropery.Name;
EA.ObjectType ot = thePropery.ObjectType;
EA.PropType p = thePropery.Type;
string valid = thePropery.Validation;
object val = thePropery.Value;
}
but I just can't find the actual parameter values.
Any ideas.....? :-[
-
Don't know for sure Bex, but perhaps it is in the RunState of the message.
-
Thanks for your reply Midnight but I can't find any reference to RunState in the Connector properties.
I'm assuming that the Connector is the right interface to use to access the message on the sequence diagram by the fact that I can get hold of info about the message e.g. its profile...
-
The weird part is that I know I've stumbled over this recently. I just cannot remember where. I keep thinking one of the tables had a series of values separated by semicolons, and the values were in there.
-
Accessing the EA.Connector:
string md1 = theConnector.get_MiscData(1);
gives the following:
"retval=int;params=;paramsDlg=P1, P2;retatt=Add;"
Which defines the profile of the operation but alas not the actual parameter values - hopefully it''ll come to you in a moment of inspiration!
-
Check your PM Bex.
-
Thanks to Midnight, the answer is to access:
t_connector.StyleEx
This yields the following:
aliasparamsTO=int, int;paramvalues=3,2;
allowing the actual parameter values to be obtained.
Once again, many thanks to Midnight for his support.
-
Is there no other way than to get it from the database? This would be a crying shame.
-
Frank,
The point Bex makes is that you can get at it from the API. Grab a reference to the Message - it is a type of connector - and use the StyleEx property.
David
-
The point Bex makes is that you can get at it from the API. Grab a reference to the Message - it is a type of connector - and use the StyleEx property.
Ah, allright. Didn't get that. "t_connector" made me think it was about a table.
It's still a shame that all these StyleEx and CustomCommand things are hardly documented at all.
-
Well, it is also a table Frank. You can do it both ways.
I totally agree with you about the lack of documentation. Around the time of 6.5 they seemed to be making an effort. This is where the SDK seems to have sprung from. Since then they've been trying to get the rest of the product documentation up to snuff, at tall order indeed. Somehow the nascent SDK got itself reincorporated into the main documentation set. They've improved it when they've had time, but it needs to be written again, from top to bottom (in whichever order).
As near as I can see, the only documentation of the attribute I cite above is out of date. It says the attribute is not used. Sometime around EA 7.0 this statement appears to have become obsolete.
David