Author Topic: Configuring Element Label in Project Browser  (Read 3964 times)

mmontminy

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Configuring Element Label in Project Browser
« 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
Martin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Configuring Element Label in Project Browser
« Reply #1 on: October 12, 2018, 11:21:38 pm »
No, not in the current version, but you can always send in a feature request

Geert

mmontminy

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Configuring Element Label in Project Browser
« Reply #2 on: October 13, 2018, 01:33:31 am »
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, I'm afraid that it will be a mess before too long.

Martin
Martin

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Configuring Element Label in Project Browser
« Reply #3 on: October 13, 2018, 07:51:39 am »
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.
Happy to help
:)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Configuring Element Label in Project Browser
« Reply #4 on: October 15, 2018, 10:59:49 am »
Being able to configure the Element Label in the Project Browser would be very useful for all sorts of reasons.

Gets my vote.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

mmontminy

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Configuring Element Label in Project Browser
« Reply #5 on: October 15, 2018, 11:53:06 pm »
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
Martin

mmontminy

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Configuring Element Label in Project Browser
« Reply #6 on: October 16, 2018, 06:11:48 am »
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
Martin