Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: mmontminy on October 12, 2018, 11:14:02 pm
-
Hi,
Is there a way to configure the label of an element in the project browser? Specifically, I would like to append the version to the name of the element so that I could quickly differentiate between different versions of an element.
Thanks,
Martin
-
No, not in the current version, but you can always send in a feature request (https://www.sparxsystems.com/support/forms/feature_request.html)
Geert
-
Any thoughts on how to achieve the same goal "differentiate between different versions of an element"? The only one I could think of was to put them in separate packages but as I mentioned in my previous post Time Aware Modeling Best Practices Request (https://www.sparxsystems.com/forums/smf/index.php/topic,40872.0.html), I'm afraid that it will be a mess before too long.
Martin
-
Version Control in a model has always been problematic across as many tools as I can remember. I'm not convinced anyone has perfected a solution yet. I can remember having long discussions with consultants back in the 1990s regarding how to implement version control in a model with the complexities of elements, relationships and diagrams. We never came up with a solution that would address all the scenarios just some of them. We ended up with similar things to Baselining and the Time Aware Modelling. Neither a perfect solution but workable.
In Sparx EA you can version control a package with all the elements and diagrams in it using version control system or baselining built into Sparx EA. The problem with that approach is you only see a snapshot of the elements.
Time Aware modelling has a different approach where it makes a clone of the elements but the problem as you say it gets messy real quick. You need to be really disciplined in how to structure the model to use that feature.
Thoughts on how to achieve your goal? Well here are some; As the project browser only shows name and stereotype for the elements as far as I can tell the only kludges I can come up with are to either
a) hijack the stereotype field and put version in it. But that won't work if you are using anything other than standard UML without stereotypes as the other notations use stereotype to define the element types.
b) Annotate the name with the version either as a prefix or postfix.
You could use time aware modelling to clone the new versions followed by some script to update and append the versions or maybe a custom transformation script to automatically add version the stereotype or name.
Both sound painful and labour intensive but if thats what you want to do there you go.
-
Being able to configure the Element Label in the Project Browser would be very useful for all sorts of reasons.
Gets my vote.
Paolo
-
1990s !!! Now I understand your emoji's :)
I've been in the field of ALM tools for a while especially RM with DOORS and MKS and we had similar challenges.
I looked at version control/baseline and TAM and see them as complementary.
I am new to E.A and wanted to make sure I did not missed any out-of-the-box capability.
I will look into adding a postfix to the element name through a script.
Thank you very much for the feedback, it is valuable
P.S. I will submit a feature request and see how it goes
-
I wrote a little VB script that seems to do the job...
Here is the first version. Could be optimized. Could be adapted and generalized for other type of information. Comments are welcome!
sub UpdatePackage ( thePackage )
' Cast thePackage to EA.Package so we get intellisense
dim currentPackage as EA.Package
set currentPackage = thePackage
Session.Output( currentPackage.Name & " (PackageID=" & currentPackage.PackageID & ")" )
' Process Current package
UpdateElements currentPackage
' Recursively process any child packages
dim childPackage as EA.Package
for each childPackage in currentPackage.Packages
UpdatePackage childPackage
next
end sub
sub UpdateElements ( thePackage )
' Cast thePackage to EA.Package so we get intellisense
dim currentPackage as EA.Package
set currentPackage = thePackage
dim currentElement as EA.Element
dim elementName
dim pos
dim lenght
dim curVersion
dim newVersion
dim newElementName
for each currentElement in currentPackage.Elements
Session.Output( "::" & currentElement.Name & _
" (" & currentElement.Type & _
", ID=" & currentElement.ElementID & ")" )
' verifies if version already exist in name
pos = InStr(currentElement.Name, "(v")
if (pos = 0) then 'no version in name
' appends version at the end
elementName = currentElement.Name + " (v" + currentElement.Version + ")"
Session.Output("Appends version- current: " + currentElement.Name + " new: " + elementName)
currentElement.Name = elementName
currentElement.Update()
currentElement.Refresh()
else
' replace version with new version
elementName = currentElement.Name
lenght = Len(elementName)
curVersion = Right(elementName, lenght-pos+1)
newVersion = "(v" + currentElement.Version + ")"
newElementName = Replace(elementName, curVersion, newVersion)
Session.Output("Replace version- current: " + currentElement.Name + " new: " + newElementName)
currentElement.Name = newElementName
currentElement.Update()
currentElement.Refresh()
end if
next
end sub