Book a Demo

Author Topic: MDA Connectors  (Read 4419 times)

ebadude

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
MDA Connectors
« on: June 03, 2005, 09:57:11 am »
I am having trouble adding connectors to models using MDA transforms.

From examining the documentation and the included templates, it appears as though you need to have an exisiting connector in your source model in order to have a connector appear in your target model. There doesn't seem to be a way to create entirely new connectors in you target.

In order to become familiar with the MDA templates, I have been trying to create some simple transform templates. I have created a transform (Language)called "AddChild" which simply takes an existing class and creates a "child" class which is connected back to the existing class.

I have just used two templates (File and Class) as follows:

File:

%list="Class" @separator="\n\n" @indent="  "%


Class:

Class
{
   %TRANSFORM_REFERENCE("AddChild")%

name="child"
}
Dependency
{
%TRANSFORM_REFERENCE("Connector",classGUID)%
Source  
{  
%TRANSFORM_REFERENCE("Class",classGUID)%  
}  
Target  
{  
%TRANSFORM_REFERENCE("Class",classGUID)%  
}  
}



I am not sure I understand the template lanuguage completely but from what I can tell I would need to know the GUID of the newly created child class so that this GUID can be used in the definition of the connector. Unfortunately it seems that you can't get the GUID of the new child class until after the new model had been generated. Is this correct?


Any suggestions on how to create new connectors would be greatly appreciated :)

On another note ... it would be really cool if you could model templates as UML diagrams and make roundtrip updates to the templates from the UML diagrams. Also, it would be nifty to be able to call cascading transforms. I think this shouldn't be too difficult to implement using execAddin(). Also, along the same lines, it would be helpful to map out a an entire tranformation pipeline or network as a UML diagram that could be executed.  ... so many ideas .... so little time  :(

Thanks for your help.

ebadude

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: MDA Connectors
« Reply #1 on: June 03, 2005, 02:18:12 pm »
Intermediary Language Reference

As a follow-up to my previous post... could you tell me where to look for the reference documentation of the the "Simple Intermediary Language". The help docs make reference to the fact that there are standard element properties ...

<element>         ::= <elementName> "{" (<elementProperty> | <element>)* "}";  

<elementProperty>   ::= <propertyName> "=" "\"" <*stringEscape> "\"";  
 
· <elementName> is any one of the set of element types that EA supports.  

· <propertyName> is any one of the set of properties that elements can have in EA.  


I can't seem to find any reference for the <propertyName>'s cited. There is some material in the Help in ...

Automation and Scripting
-> The Automation Interface
  -> Reference


.... but these don't seem to map well when I try to use them.

Sparx ... Would you be able to post the full grammar for the Intermediary Language?

Specifically, I was trying to explicitly define the GUID for a class in the intermediary language (maybe this is bad). As mentioned in my earlier post, I am trying to create a new class with a new connector on a diagram. Connectors need to have a source and a target (which are identified by their GUID's).  I thought I might be able to get it working if I could specify the GUID for my new (target) class and thereby wire the connector from source to target.

Any suggestions?

Thanks

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDA Connectors
« Reply #2 on: June 05, 2005, 04:23:19 pm »
From the help file
Quote
Connectors can be created between any two classes that have previously been created by a transformation

The help file (MDA-Style Transforms | Writing Transformations | Transforming Connectors) goes into this in more detail with an example of creating a connector where none existed previously and creating a connector from another connector.

As for the property names, they are derived from the template substitution macro names, just without the "class" (or whatever) prefix.  The guid is not included for data integrity purposes.

Simon
« Last Edit: June 05, 2005, 04:23:37 pm by simonm »

ebadude

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: MDA Connectors
« Reply #3 on: June 06, 2005, 10:56:43 am »
Hi Simon,

Thanks for the prompt reply.

The help page you cited was the central page I was working from to try to create a connector. Unfortunatley, it doesn't give any assistance to anyone wanting to create new connectors to new diagram elements.

I tried creating a connector between 2 existing classes (as an experiment) and this caused EA to crash.

My objective is to be able to have a transform that creates a new class and connects it to an existing class. I think this would be a very common scenario.

Can you post a sample of how to accomplish this?

Also, would you be able to post the full grammar for the Intermediary Language?  

Thanks for your help.

thomaskilian

  • Guest
Re: MDA Connectors
« Reply #4 on: June 08, 2005, 03:40:39 am »
Quote
...
Also, would you be able to post the full grammar for the Intermediary Language?  
...

That would really be helpful. I gave up when the transformation claimed that it doesn't know "Dependency" :-/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDA Connectors
« Reply #5 on: June 08, 2005, 04:05:28 pm »
Hi guys,

Where did the existing classes come from?  According to the help file I previously referred you to. In order to create a connector between them you have to know for each of them.
  • What transformation they came from. (This can be implicit if it's the current transformation.)
  • The unique name that they were created with within the transformation.  (This is not the actual class name, it's the name given to them in the TRANSFORM_REFERENCE macro)
  • The guid of the class that it was originally transformed from.
So, the classes on each end need to have been transformed, and you need to have some sort of link between the original classes in order to know that there is a link.  (This could be an actual connector, they were actually the same class, a tagged value containing the guid of the other one, an attribute (etc.) classifier that an addin looks up the GUID from the ID, or something else)

If EA crashed doing a transformation, please send an email to [email protected] describing what you did to cause the crash.  The transform templates that you used will probably be needed.  (Tools | Export Reference Data)

I don't think we'll be publishing the actual grammar (or at least not yet) but we are including more details in the documentation.

Thomas, my guess (without seeing anything) is that currently classes can't contain connectors in the grammar.  At least I think I remember seeing something like that.  If it is true then I'll fix it not too far away.

Simon

thomaskilian

  • Guest
Re: MDA Connectors
« Reply #6 on: June 09, 2005, 09:41:04 am »
Hi Simon,
thanks in advance. You can probably create the error message yourself. Just use the C#-transformation for classes that have Dependency relations. I used  that transformation to simply create copies of existing classes, but it could not copy the Dependency.

ebadude

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: MDA Connectors
« Reply #7 on: June 10, 2005, 12:46:20 am »
Hi Guys,

Thanks for your help.

I have looked into it a little further and I think this is the list I was after:

Based on the grammar from the docs
<elementProperty>   ::= <propertyName> "=" "\"" <*stringEscape> "\""; 


Legal PropertyNames:


name
stereotype
author
scope
alias
phase
version
notes
abstract
status
complexity
language
keyword
isroot
isleaf
isSpecification
isActive
multiplicity
tag
xref
parent



I guess I'm not going to be able to get MDA Transforms to create the diagrams I was looking for (adding child classes to parents).  :(  I guess there's always the custom AddIn approach.

I have also been playing around with the RTF Style Templates and trying to make more robust generated docs. I gathered all the #MACRO# variables I could find and inserted the entire list of variables into each template. It appears as though the doc generator is hard-coded to use only the variables that are already in the default templates. I suspect the same coding approach was taken throughout the MDA and code generators as well.

I have to re-think my approach to model generation. If anyone has any other solutions that have worked, I would be very interested in any guidance you can offer.




Thanks again for your help.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: MDA Connectors
« Reply #8 on: June 21, 2005, 05:39:58 pm »
Quote
Hi Simon,
thanks in advance. You can probably create the error message yourself. Just use the C#-transformation for classes that have Dependency relations. I used  that transformation to simply create copies of existing classes, but it could not copy the Dependency.


An dependency link to/from an inner class does the job.  I'll have to fix that up in the grammar.

Simon

thomaskilian

  • Guest
Re: MDA Connectors
« Reply #9 on: June 22, 2005, 01:11:48 am »
Thanks, Simon :)