Your advice seem to be correctly registered. When the creation command is built the getBeforeCreateCommand() & getAfterCreateCommand() of the
Pin IElementType never get called, what is called during command creation is getBeforeCreateCommand() & getAfterCreateCommand() of the IElementType matching the container of the element you try to create.
De : mdt-papyrus.dev-bounces@xxxxxxxxxxx [mailto:mdt-papyrus.dev-bounces@xxxxxxxxxxx]
De la part de DAUSSY Arthur
Envoyé : mercredi 21 décembre 2011 14:23
À : Papyrus Project list
Objet : Re: [mdt-papyrus.dev] UML Service type
Hi Yann,
First thanks for your quick answer.
I am currently improving how Pins are handled in the Activity Diagram. This improvement concern how they are handled by groups.
(See Activity Group in UML Superstructure).
For the moment, MDT Papyrus has a Group Framework which handle most of cases however the case of Pin is a bit tricky. So I would like to
use a Helper Advice in order to use the getAfterCreateCommand.
In order to register the helper advice I have tried two methods:
First I have manually added the following extension:
<!-- UML ElementType bindings to Papyrus shared IClientContext -->
<extension
point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
<!-- Bindings declaration -->
<binding
context="org.eclipse.papyrus.service.edit.TypeContext">
[…]
<advice
ref="org.eclipse.papyrus.uml.advice.Pin"
/>
[…]
</binding>
</extension>
And
<!-- Helper advice declarations -->
<extension
point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
<metamodel
nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
[…]
<!-- Helper advice for Property -->
<adviceBinding
id="org.eclipse.papyrus.uml.advice.Pin"
class="org.eclipse.papyrus.uml.service.types.helper.advice.PinHelperAdvice"
inheritance="all"
typeId="org.eclipse.papyrus.uml.Pin">
</adviceBinding>
[…]
</metamodel>
</extension>
Next I have tried to add it on the model ElementTypeModelForUML.domaincontextcodegen and use the action “Generate all Elements Type Model”.
However in both cases the method getAfterCreateCommand is never call. So I might have missed something but I’m not able to figure what.
Regards,

|
Arthur Daussy
Atos Origin Intégration
6 impasse Alice Guy
BP 43045
31024 Toulouse Cedex 3
Telephone : +33 (0) 5 34 36 32 90
www.atos.net
|
Hi Arthur,
You can actually add a new advice manually.
Can you be more specific about what you intend to do ? What is not working ? How did you register the new advice ?
Best regards,
Yann
Hi everyone,
I would like to use the UML service type to register a HelperAdvice on Pin elements. I have tried to use the “ElementTypeModelForUML.domaincontextcodegen”
with its editor to generate all needed extensions however nothing seems to work. I’m not sure the “Generate all Elements Type Model” is correctly working. I have also tried to manually register all extension but it doesn’t seem to work.
Would anybody have an idea of what I am doing wrong?
Thanks for any help you could give me?
Regards,

|
Arthur Daussy
Atos Origin Intégration
6 impasse Alice Guy
BP 43045
31024 Toulouse Cedex 3
Telephone : +33 (0) 5 34 36 32 90
www.atos.net
|
Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel.
Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos ne pourra être engagée quant au contenu de ce message. Bien
que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être engagée pour tout dommage résultant d'un virus transmis.
This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet,
the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting
from any virus transmitted.