cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Macro on a MetaAssoci​ation

linhbui
Super Contributor

Hi,

 

I notice a Macro can connect to a MetaAssociation. What are available VB functions that I can implement for this Macro in order to execute some actions after an asociation is established.

Eg. When connect an application to a database, also connect the application to data model of the database.  Thanks

4 Replies

Hello Lionel,

 

sounds like a good trick I could use Man Wink but I do not understand one point :

 

How do you know that there is a change in the number of associated objects ? According to what I know, the macro will be executed almost everytime you modify the object and/or open a diagram with the object inside, and not only when you create a new metaAssociation (which, depending on what you want do do, might not be a problem...)

The only thing I see, to respond to linhbui's problem, would be something like :

For each oDataBase in oToBeRuled.getCollection("DataBase")
  <...>
Next

 Which means the <...> code will be executed each time the rule is applied, even when no changes has been made in the number of metaAssociations.

 

How do you manage this ?

 

Lionel

<script id="F5_watermark" type="text/javascript"></script>

lmazurie
Honored Contributor


A community is a way to have fun no ?

So if you want to trigger a macro when there is an event on a metaAssociation ... you can create a rule on the metaclass and when there is a new or a change in the number of  associated objects in a MetaAssociation the macro linked with the Modeling Rule is executed ... But a little tricky no ?

Lionel Mazurié

linhbui
Super Contributor

I see. Thanks for the clarification, Lionel.

lionel
MEGA
MEGA

Hello linhbui,

 

I'm sorry, but there are not (yet ?) ways to execute a macro when establishing an association between object.

Macros linked to metaAssociations have other internal purposes (for managing links with virtual metamodel for example).

 

Regards,

 

Lionel