Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: johnm9 on November 21, 2008, 10:38:21 pm
-
I'm trying to change the stereotype of an Attribute from "Attribute" to "XSDAttribute" with the following VBA code:
Set att = ele.Attributes.GetAt(i - 1)
If att.StereotypeEx = "Attribute" Then
att.StereotypeEx = "XSDAttribute"
att.Update
End If
However, the result is <<XSDAttribute, Attribute>>. It ends up that one more stereotype is added instead of changing it.
I've tried to use "att.Stereotype" instead of "att.StereotypeEX" but no luck.
Please advice. :-[
-
Try explicitly clearing the string, then updating, then setting the new value (and updating again of course).
If you are using the most recent build of EA (833 at this time) then you should report this as a bug to Sparx. Either the documentation or the product is incorrect. Use the Report a Bug link near the bottom of any forum page.
David
-
You mean something like this, right? I had tried it. Same result.
Set att = ele.Attributes.GetAt(i - 1)
If att.StereotypeEx = "Attribute" Then
att.StereotypeEx = ""
att.Update
att.StereotypeEx = "XSDAttribute"
att.Update
End If
I have also try this, it ends up as <<, Attribute>>. :-/
Set att = ele.Attributes.GetAt(i - 1)
If att.StereotypeEx = "Attribute" Then
att.StereotypeEx = ""
att.Update
End If
-
That's exactly what I meant. The result you are getting certainly seems incorrect.
So on the the next part of my post. First ensure that you are testing against the most recent EA build (833). If the bug is present there, fire in that bug report immediately. You might make the cut for getting it resolved in the next build or two.
Timing is important here. The delay could be considerable if the issue does not get handled before the run-up to EA 7.5. Once that process begins there will probably be a waiting period of a few builds (which will be alpha tests, not released to the community). When the beta builds do come out there will be plenty of other things going on, so this issue could get further delayed.
NB: If we're really lucky this is simply a documentation issue. Still, the bug report could be the trigger for getting it resolved.
David