Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo getValue problem with port metaclass(Acceleo papyrus profile data access for port metaclass)
Acceleo getValue problem with port metaclass [message #1853369] Wed, 29 June 2022 14:33 Go to next message
Niyazi Cem Degirmenci is currently offline Niyazi Cem DegirmenciFriend
Messages: 1
Registered: June 2022
Junior Member
Hi, I am using Papyrus version 4.22 and acceleo 3.7.11

In my papyrus profile I create a Stereotype from Port Metaclass with a variable.
It is however impossible to read the value from acceleo for ports.

Inside the target uml I have a composite structure diagram with classes together with ports

[aClass.getValue( aClass.getAppliedStereotype('Test::Module'),'Memory')/] works for the Class elements but not for Port type elements. (I can not reach the value)

Is it possible to reach the information stored in papyrus profiles for port elements from a loop like this?

[template public generateElement(aClass : Class)]
[comment @main/]
[file (aClass.name + '.cpp', false, 'UTF-8')]
[for (e: uml::NamedElement | aClass.ownedElement ) ]


Thank you,
Re: Acceleo getValue problem with port metaclass [message #1853424 is a reply to message #1853369] Fri, 01 July 2022 11:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7670
Registered: July 2009
Senior Member
Hi

This seems unlikely, but I vaguely recall a similar query that was resolved to a misunderstanding of the structure of Ports.

It is very easy to get confused and use the wrong meta-level when working with Stereotypes and the getAppliedSteeotype API is totally not typesafe so you get minimal error diagnosis just "it doesn't work", for which you have little option to go in with Java debugger and discover where the misunderstanding/typo arises. If you are lucky you can saturate your Acceleo template with 'printf' output and so discover exactly which step deviates from your expectation. aClass.getValue( aClass.getAppliedStereotype('Test::Module'),'Memory') has at least one intermediate worthy of diagnosis.

Regards

Ed Willink
Re: Acceleo getValue problem with port metaclass [message #1854018 is a reply to message #1853369] Thu, 28 July 2022 08:18 Go to previous message
pere joseph rodríguez is currently offline pere joseph rodríguezFriend
Messages: 51
Registered: October 2014
Member
Have a try to the methods getStereotypeHierarchy and getTaggedValue from
https://github.com/perelengo/org.eclipse.acceleo.module.samsarasoftware.sql.custom/blob/master/src/org/eclipse/acceleo/module/samsarasoftware/sql/common/DatabasePersonalizableQueries.mtl

Maybe is an acceleo version bug, because I can get tagged values.
Previous Topic:[Acceleo] Deploying Plug-In Problem
Next Topic:Acceleo 4.0.0 ?
Goto Forum:
  


Current Time: Thu Sep 19 04:31:55 GMT 2024

Powered by FUDForum. Page generated in 0.04513 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top