Book a Demo

Author Topic: Capturing Connector Message Data  (Read 7279 times)

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Capturing Connector Message Data
« on: February 27, 2016, 03:03:32 am »
My model in EA 12.1 has a number of use cases with sequence diagrams.  Each connector in the sequence diagram has detailed message information.  The information I am interested in includes:  diagram where the message/connector is used, order / sequence of the messages, message name and parameters, condition (we use this to describe the trigger for the message), notes, sender and receiver.  Even though messages are reused across multiple diagrams, the condition and notes are unique to each instance.

Using a script, I have been able to collect the following:
- Diagram name
- Connector sequence number
- Connector name (Message with parameter)
- Connector supplier name (Sender)
- Connector client name (Receiver)
- Connector Notes

I have not been able to find a field that contains the connector/mesage "condition".  Any suggestions?

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Capturing Connector Message Data
« Reply #1 on: February 27, 2016, 03:07:09 am »
t_connector.Btm_Mid_Label (p. 80 of my Inside book).

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Capturing Connector Message Data
« Reply #2 on: February 27, 2016, 04:08:14 am »
I'm new to scripting in EA and don't know how to translate your response to use in the script.  The script is written in VB.

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Capturing Connector Message Data
« Reply #3 on: February 27, 2016, 07:44:23 pm »
Issue a
Code: [Select]
Respository.SQLQuery("SELECT Btm_Mid_Label FROM t_connector WHERE connector_id = <theId>")where <theId> is the appropriate connector id.

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Capturing Connector Message Data
« Reply #4 on: March 01, 2016, 05:17:14 am »
I ended up with a slightly different statement:

messageConnectorTemp = Repository.SQLQuery ("SELECT Btm_Mid_Label FROM t_connector WHERE connector_id = " & temp.ConnectorID)

The main issue I had with the output is that extra data comes both before and after the text string that I'm interested in.  I used "Replace" statements to remove the data and I now have useable text.

Thank you, Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Capturing Connector Message Data
« Reply #5 on: March 01, 2016, 08:13:35 am »
If you're going to work on larger result sets you should use a DOM parser for the XML output that comes out of the SQLQuery. But for a single returned row a simple string manipulation is sufficient.

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Capturing Connector Message Data
« Reply #6 on: March 02, 2016, 10:11:53 am »
I decided to try your suggestion and it resolved a problem that I encountered with the "Replace" function.  For some reason, I was getting an extra carriage return between the text "Trigger:  " and the data obtained from the SQL query.  This extra carriage return is now gone using the XML DOM tools.

Thank you for the suggestion.

Gayle