Hi!
1) I haven't used this construct but it looks C-like to me. In that case you need to use it as an expression, not a statement. In other words, it can't stand on its own, you need to put it into something like
stereotype = %qt%%connectorStereotype=="myOldStereotype1" ? "myNewStereotype1" : "myNewStereotype2"%%qt%Please note that I haven't tested that and you might need to fiddle around with " and % characters and the %qt% macro to get it right.
Either way, you should be alright using a branching control macro instead - that's an If statement to us mortals. Something like:
%if connectorStereotype == "myOldStereotype1"%
stereotype = "myNewStereotype1"
%else%
stereotype = "myNewStereotype2"
%endIf%This is useful if you only want to do a few things differently depending on the stereotype. If, however, you find yourself in a situation where that %if% statement encloses the whole template, you might want to consider adding a stereotyped override template instead. A stereotyped override gets called
instead of the base template for those elements where the stereotype is the one you've specified.
2) It looks like you've missed adding "stereotype" to the <listOfExcludedItems> in TRANSFORM_CURRENT.
TRANSFORM_CURRENT copies everything from the element being transformed into the new element
except for the items you list, so in your case you should probably put in something like:
%TRANSFORM_CURRENT("stereotype")%You will still be able to use the old element's stereotype (%connectorStereotype%) in the template, it just won't be copied into the new element.
3) That's not what the connectorTag macro does. You can't set things with it, only extract. If the connector in the element being transformed has a string tag "Blarg" with the value "Honk", then
%connectorTag:"Blarg"%will result in the string "Honk" being placed in the newly transformed element. If you want to add a new Tagged Value to the element being created the keyword is Tag, as in
Tag
{
name = "PapasGotA"
value = "BrandNewTag"
}Hope that helps. If not, holler.

Cheers,
/Uffe