Author Topic: Document Generation Sequence Diagram Descriptions?  (Read 5480 times)

Mr.Scott

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Document Generation Sequence Diagram Descriptions?
« on: December 12, 2015, 09:35:02 am »
Hi, I am generating a document with a sequence diagram and I am trying to understand how to write a query to get the description off of the operation on the component object.  Does anyone know how to link the operation on the sequence line to the component's operation?

Here are the steps I am taking:
On Sequence Diagram add components as an 'instance'
On sequence lines, select an operation defined on the component.

The query below returns the description on the sequence line on the diagram.
SELECT c.SeqNo, c.Name as FUNCTION_NAME, c.Notes as DESCRIPTION, c.SourceConstraint AS IMPACT
FROM t_connector AS c
WHERE (c.Connector_Type = 'Sequence')
AND (c.DiagramID = #INSERT DIAGRAM ID#)
ORDER BY c.SeqNo

From the object model and the queries I have tried it's not clear how to map the operation on the sequence back to the component's operation.  Do you know what tables I need to look at to do a join on?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Document Generation Sequence Diagram Descripti
« Reply #1 on: December 12, 2015, 04:34:11 pm »
Here's the code I use in the Message wrapper to get a hold of the Operation

Code: [Select]
public UML.Classes.Kernel.Operation calledOperation
{
      get
      {
            UML.Classes.Kernel.Operation returnedOperation = null;
            foreach (global::EA.ConnectorTag tag in this.wrappedConnector.TaggedValues)
            {
                  if (tag.Name == "operation_guid")
                  {
                        returnedOperation = this.model.getOperationByGUID(tag.Value);
                  }
            }
            return returnedOperation;
      }
      set
      {
            throw new NotImplementedException();
      }
}

The message contains a tagged value that holds the operations GUID

Geert

Mr.Scott

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Document Generation Sequence Diagram Descripti
« Reply #2 on: December 15, 2015, 11:55:05 am »
Your approach makes sense and looks good.  A friend suggested I look at the 't_connectortag' table and I was able to do it on a SQL join using the join below.  I may try swapping to the operation approach.

...
FROM t_connector AS c
LEFT JOIN t_connectortag ct on (ct.elementID = c.Connector_ID)
LEFT JOIN t_operation o on (o.ea_guid = ct.value)
...