Book a Demo

Author Topic: Documenting Information Items between Elements  (Read 3082 times)

Paul H

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Documenting Information Items between Elements
« on: February 21, 2012, 02:47:49 am »
Hi all - Is there a way I can create an RTF of Information Items Conveyed between elements ?

I've created 'shared' elements that are used within a number of packages.  I need to be able to document information flows in to and out of that single element by name.  The standard report will produce the type of Connection, i.e.
{Connector.Type} gives me Information Flow
but I can't seem to find the correct way for the RTF to disclose what the Information Items are conveyed on the Information Flow.

Any help would be appreciated as if this is not the correct way to describe then I want to stop using the RightClick->Advanced->Information Items Conveyed way of working before the model gets too big !
(Ver - 8.0.857)

Many thanks

Paul H

Rhys Lewis

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Documenting Information Items between Elements
« Reply #1 on: February 27, 2012, 11:50:22 am »
I would also be interested in ways to trace conveyed items within the model in EA itself.  For example if I have an item that is being conveyed in flows between objects it would be good to have an option "Find in connectors" to see where it has been used in that way.

The Relationships window could be a useful place to see items conveyed.  Currently if there is more than one item being conveyed between two components, they will appear as separate by identical items in the relationships window, and there is no way to tell which is which.

Rhys Lewis

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Documenting Information Items between Elements
« Reply #2 on: March 02, 2012, 11:50:53 am »
Here's an XSL template that I've used for displaying items conveyed between objects.  A bit crude, but gets the job done.  Export a package to XMI, then use Xalan to convert to HTML like so:

Xalan.exe my.xml my.xsl > out.html

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:UML="omg.org/UML1.3"
                        xmlns="http://www.w3.org/1999/xhtml" version="2.0"
                        >

      <xsl:template match="XMI[@xmi.version='1.1']">
      <HTML>
      <!-- loop through each of the diagrams -->
      <!--xsl:apply-templates select="XMI.content/UML:Diagram[@name='If you just one to choose one, do it here']"/-->
      <xsl:apply-templates select="XMI.content/UML:Diagram"/>
      </HTML>
</xsl:template>

<!-- error message if the XMI version is wrong -->
<xsl:template match="XMI">
   <xsl:message terminate="yes">Unknown XMI version</xsl:message>
</xsl:template>

<!-- for each diagram, put it's name in a title, and go through the elements -->
<xsl:template match="UML:Diagram">
      <h1><xsl:value-of select="@name"/></h1>
      <xsl:apply-templates select="UML:Diagram.element/UML:DiagramElement"/>
</xsl:template>

<xsl:template match="UML:DiagramElement">
      <!--div><xsl:value-of select="@subject"/></div-->
      <xsl:param name="subject" select="@subject"/>
      <!-- loop through all of the UML associations that have been found as elements on this diagram.  Associations belonging to objects on the diagram that are not displayed on the diagram will not be included. -->
      <xsl:apply-templates select="//UML:Association[@xmi.id=$subject]"/>
</xsl:template>


<xsl:template match="UML:Association">
<div>
<!-- the text name of the source object -->
<xsl:for-each select="UML:ModelElement.taggedValue/UML:TaggedValue[@tag='ea_sourceName']"><xsl:value-of select="@value"/></xsl:for-each>:
<!-- followed by the the text name of the source object's class.  This is because instances may only be referred to by their class name -->
<!-- First find the source element, which will be tagged as "source" -->
<xsl:for-each select="UML:Association.connection/UML:AssociationEnd/UML:ModelElement.taggedValue/UML:TaggedValue[@value='source']">
<!-- Then navigate back to the parent's parent to get the classname, which is accessed by the @type value -->
      <xsl:param name="type" select="../../@type"/>
<!-- retrieve the class name using the previously stored type -->
      <xsl:for-each select="//UML:Component[@xmi.id=$type]/UML:ModelElement.taggedValue/UML:TaggedValue[@tag='classname']"><xsl:value-of select="@value"/></xsl:for-each>
</xsl:for-each> -

<!-- Show the text tag for the conveyed items in brackets.  This is no the definitive name if the text label has been modified -->
(<xsl:for-each select="UML:ModelElement.taggedValue/UML:TaggedValue[@tag='mt']"><xsl:value-of select="@value"/></xsl:for-each>)
-&gt;

<!-- Repeat the same process for target as for source -->
<xsl:for-each select="UML:ModelElement.taggedValue/UML:TaggedValue[@tag='ea_targetName']"><xsl:value-of select="@value"/></xsl:for-each>:
<xsl:for-each select="UML:Association.connection/UML:AssociationEnd/UML:ModelElement.taggedValue/UML:TaggedValue[@value='target']">
      <xsl:param name="type" select="../../@type"/>
      <xsl:for-each select="//UML:Component[@xmi.id=$type]/UML:ModelElement.taggedValue/UML:TaggedValue[@tag='classname']"><xsl:value-of select="@value"/></xsl:for-each>
</xsl:for-each>
</div>

</xsl:template>


</xsl:stylesheet>