Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Self(Operation).setType(newType: Type)(Kindly reply me how to use this function)
Self(Operation).setType(newType: Type) [message #1791577] Mon, 02 July 2018 15:17 Go to next message
Israr Ahmad is currently offline Israr AhmadFriend
Messages: 4
Registered: July 2018
Junior Member
Hey:
I am new in acceleo eclipse (M2T) transformation, kindly help me how to use Self.setType(newType: Type) function of OCL. Specially how to define newType:Type of self.setType(newType: Type).

Regards:
Re: Self(Operation).setType(newType: Type) [message #1791586 is a reply to message #1791577] Mon, 02 July 2018 16:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6113
Registered: July 2009
Senior Member
Hi

OCL is a side-effect free language so there is no operations such as setType. You need to be much clearer about what you are trying to do, probably with a repro.

Regards

Ed Willink
Re: Self(Operation).setType(newType: Type) [message #1791602 is a reply to message #1791586] Mon, 02 July 2018 17:47 Go to previous messageGo to next message
Israr Ahmad is currently offline Israr AhmadFriend
Messages: 4
Registered: July 2018
Junior Member
Hey:
Thanks to reply me, I have an operation in uml class without return type and assign the return type to that operation in acceleo M2T transformation code like i am doing with Self.setType(newType: type), or give me some alternative way to do it.

Regards:
Re: Self(Operation).setType(newType: Type) [message #1791606 is a reply to message #1791602] Mon, 02 July 2018 19:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6113
Registered: July 2009
Senior Member
You need to be much clearer about what you are trying to do, probably with a repro.
Re: Self(Operation).setType(newType: Type) [message #1791625 is a reply to message #1791606] Tue, 03 July 2018 07:16 Go to previous messageGo to next message
Israr Ahmad is currently offline Israr AhmadFriend
Messages: 4
Registered: July 2018
Junior Member
Hey:
Ok, I have attached two .PNG file where you can see in "UML class diagram" file, operations "DAO" without return type and a applied stereotype "Operation_Req" which will be decide its return type in M2T transformation code.
In Second file "M2T-Code", where I want to generate code of return type of DAO operation with the help of applied stereotype.
Kindly help me how can do it?

Regards:
Re: Self(Operation).setType(newType: Type) [message #1791640 is a reply to message #1791625] Tue, 03 July 2018 09:02 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6113
Registered: July 2009
Senior Member
Hi

Screen shots do not provide a repro, but in this case I can perhaps guess at what you are trying to do; you might find https://wiki.eclipse.org/OCL/ForumNetiquette helpful.

Acceleo is a Model to Text language so most expressions contrbute output text. [o.setType(newType)/] does not obviously have an text value and appears to attempt to modify the input model which is illegal in a declarative language. If the value in o.type does not suit your [urposes you propbabkly want to write a getType() helper that returns the corrected working value rather than trying to correct the input.

Regards

Ed Willink
Previous Topic:Acceleo creating a UI launcher "Acceleo Model to text"not found
Next Topic:[ACCELEO] Big integers
Goto Forum:
  


Current Time: Mon Nov 19 13:07:43 GMT 2018

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

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

Back to the top