Book a Demo

Author Topic: Change the default Status for a custom stereotype  (Read 4233 times)

MDManning

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Change the default Status for a custom stereotype
« on: March 17, 2011, 12:46:23 am »
I've created an MDG file with a UML Profile with a few stereotyped elements.  Upon dragging those elements onto a diagram I'd like the Status property set to "Implemented".  From the help; it doesn't look like "Status" is a supported attribute but the tool is so flexible I figured there is probably a way.  Ideas?

thea

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Change the default Status for a custom stereot
« Reply #1 on: March 17, 2011, 03:37:13 pm »
Could you please post the code for this?
---------------------------------------------------------------------------------------------------------------
If your tried 10x and failed, try again.  We'll never know if we'll get it right on our next try.

MDManning

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Change the default Status for a custom stereot
« Reply #2 on: March 18, 2011, 01:30:58 am »
If by code you mean XML; I can include a snipit of the MDG.xml file for one attempt that I felt was most likely to succeed but did not.  However, I was more looking for general ideas of how to achieve the stated goal than specific code.  Being a newbie I'm not sure what approach to take (include in UML Profile, or create a pattern, or write code or ?).

Code: [Select]
<Stereotype name="SOR-LOB" notes="" cx="100" cy="55" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
      <Image type="EAShapeScript 1.0" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">UEsDBBQAAAAIAHijaz59zGQU1wEAADwHAAAHABEAc3RyLmRhdFVUDQAHwIV6TcCFek3AhXpN
tVXBTsJAEJ0rfkVTLpB4EBOjRvEiH2DiBxigKxDbLaGgIcR/973ZLi24WNCYTbvTzpuZN9PZ
aSFTGcpcjESSQZqJlTPZ4GpJiue15LKSJdZaUX2JIeeQE9w/gI7lTtEWz4V6c5o+cAvYmlJf
QFrKKyKkWGNgUlwL6cilXGGd7+3d0m4Gm476LRB1obENdjLqIPozpCGuFfQxrGMZQE+kQRRq
DBjF8NdVf54Jvdggjwu9fHwDPS0ou7r8htNTiWKNjuXjeOzXY5fRYeuJvicDMhvp20TlOoos
nN/PbbYp8purneNwrVXpQeaT271VoZky87lmPFWfTpchxruyyEtPPeTitYxid7Q3WGGtj92M
qEdgRZIAL9+D3zX/lc0hJozHvngTdmxIexybUPbh+vydVahDqr5w3eqxnAUJcCv0n5sN7FOe
EAs5g/yIOJlGYZ58Y7HzzHh/t1J122F/rlau35t99mocKz9RAyuiN3pvweYFWtZhAl2EaRch
wrhE8pT5udjCdzoey9kw01xGsDDaq6x4srXzHCsbTiB+6yVwVqvR3qLaOmkc0p3wer7NVWvO
2bFkfX/OlxOI/xFGOSXfOsfK7vQJ3PRXCNXxHmsgD1j1KnJnLb8AUEsBAhcLFAAAAAgAeKNr
Pn3MZBTXAQAAPAcAAAcACQAAAAAAAAAAAACAAAAAAHN0ci5kYXRVVAUAB8CFek1QSwUGAAAA
AAEAAQA+AAAADQIAAAAA</Image>
      <AppliesTo>
            <Apply type="Component">
                  <Property name="isIndirectlyInstantiated" value="true"/>
                  <Property name="status" value="Implemented"/>
            </Apply>
      </AppliesTo>
</Stereotype>

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Change the default Status for a custom stereot
« Reply #3 on: March 18, 2011, 09:06:47 am »
I think you have two choices:

1. Use a template package to set all components to be created with Status=Implemented.

Help: http://www.sparxsystems.com/enterprise_architect_user_guide/8.0/modeling_fundamentals/using_element_templates.html

2. Write an add-in that implements the EA_OnPostNewElement broadcast handler. Check that the element just created was a component with the "SOR-LOB" stereotype and set the status as required.

Help: http://www.sparxsystems.com/enterprise_architect_user_guide/8.0/automation_and_scripts/broadcastpostnewelement.html

3. Send in a feature request using the formed linked at the bottom of this page.
« Last Edit: March 18, 2011, 09:07:36 am by KP »
The Sparx Team
[email protected]

MDManning

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Change the default Status for a custom stereot
« Reply #4 on: March 19, 2011, 01:57:58 am »
Exactly what I needed.  Thanks KP!