Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] creating objects in ATL
[ATL] creating objects in ATL [message #88336] Fri, 15 August 2008 00:05 Go to next message
Eclipse UserFriend
Originally posted by: aaniculaesei.gmail.com

Hello to you all,
I am writing an ATL Transformation to transform a UML Model of a state
chart to a NuSMV Model that describes the NuSMV program which eventually
can be run to watch and verify the behavior of the state chart.

In testing my helper functions I need to be able to instantiate and run
objects belonging to the UML model (e.g. state configurations).
The question is: can I do create and instantiate objects the way it is
done in an imperative language ?

Thank you very much for help!
Adina
Re: [ATL] creating objects in ATL - defining new classes [message #88352 is a reply to message #88336] Fri, 15 August 2008 08:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: aaniculaesei.gmail.com

Hi again,
Rephrasing the question a little bit ... I need to define new classes,
instantiate objects of these classes and run them in ATL.
For example in UML Metamodel I have the Vertex class or the State class.
These classes both describe a state in a Statemachine.
Now what I want to do is define a new class to deal for example with
StateConfiguration objects.
Can this be done in ATL ? Can you point me in the right direction to
read more about it ?

Thank you very much!
Adina

Adina Aniculaesei wrote:
> Hello to you all,
> I am writing an ATL Transformation to transform a UML Model of a state
> chart to a NuSMV Model that describes the NuSMV program which eventually
> can be run to watch and verify the behavior of the state chart.
>
> In testing my helper functions I need to be able to instantiate and run
> objects belonging to the UML model (e.g. state configurations).
> The question is: can I do create and instantiate objects the way it is
> done in an imperative language ?
>
> Thank you very much for help!
> Adina
Re: [ATL] creating objects in ATL - defining new classes [message #88381 is a reply to message #88352] Fri, 15 August 2008 10:03 Go to previous messageGo to next message
Alfons Laarman is currently offline Alfons LaarmanFriend
Messages: 71
Registered: July 2009
Member
Hi Adina,

You could use lazy rules and called rules.
rule createClass(String name) {
to c: UML!Class (
name<-name;
)
}

and call it for example in the etrypoint rule:
entrypoint rule Start { -- don't call it main!
thisModule.createClass("aClass");
}

Regards,

Alfons

"Adina Aniculaesei" <aaniculaesei@gmail.com> schreef in bericht
news:g83fjv$7ch$1@build.eclipse.org...
> Hi again,
> Rephrasing the question a little bit ... I need to define new classes,
> instantiate objects of these classes and run them in ATL.
> For example in UML Metamodel I have the Vertex class or the State class.
> These classes both describe a state in a Statemachine.
> Now what I want to do is define a new class to deal for example with
> StateConfiguration objects.
> Can this be done in ATL ? Can you point me in the right direction to read
> more about it ?
>
> Thank you very much!
> Adina
>
> Adina Aniculaesei wrote:
>> Hello to you all,
>> I am writing an ATL Transformation to transform a UML Model of a state
>> chart to a NuSMV Model that describes the NuSMV program which eventually
>> can be run to watch and verify the behavior of the state chart.
>>
>> In testing my helper functions I need to be able to instantiate and run
>> objects belonging to the UML model (e.g. state configurations).
>> The question is: can I do create and instantiate objects the way it is
>> done in an imperative language ?
>>
>> Thank you very much for help!
>> Adina
Re: [ATL] creating objects in ATL - defining new classes [message #90081 is a reply to message #88381] Mon, 15 September 2008 05:02 Go to previous message
Eclipse UserFriend
Originally posted by: aaniculaesei.gmail.com

Hello,
Thank you for answering my question.
Here is how I wrote it, in case other people run into the same question:
rule createClass (name : String){
to c : UML!Class (
name <- name
)
}
However the following code gives me errors regarding 'thisModule':
entrypoint rule Start() {
to t : KM3!UML
do {
thisModule.createClass("StateConfiguration")
}
}
Is it a keyword to identify the current module ?

Also, I have another question: can I define for such a class, created
the way described above, operations and attributes ?

Thank you very much,
Adina

Alfons Laarman wrote:
> Hi Adina,
>
> You could use lazy rules and called rules.
> rule createClass(String name) {
> to c: UML!Class (
> name<-name;
> )
> }
>
> and call it for example in the etrypoint rule:
> entrypoint rule Start { -- don't call it main!
> thisModule.createClass("aClass");
> }
>
> Regards,
>
> Alfons
>
> "Adina Aniculaesei" <aaniculaesei@gmail.com> schreef in bericht
> news:g83fjv$7ch$1@build.eclipse.org...
>> Hi again,
>> Rephrasing the question a little bit ... I need to define new classes,
>> instantiate objects of these classes and run them in ATL.
>> For example in UML Metamodel I have the Vertex class or the State class.
>> These classes both describe a state in a Statemachine.
>> Now what I want to do is define a new class to deal for example with
>> StateConfiguration objects.
>> Can this be done in ATL ? Can you point me in the right direction to read
>> more about it ?
>>
>> Thank you very much!
>> Adina
>>
>> Adina Aniculaesei wrote:
>>> Hello to you all,
>>> I am writing an ATL Transformation to transform a UML Model of a state
>>> chart to a NuSMV Model that describes the NuSMV program which eventually
>>> can be run to watch and verify the behavior of the state chart.
>>>
>>> In testing my helper functions I need to be able to instantiate and run
>>> objects belonging to the UML model (e.g. state configurations).
>>> The question is: can I do create and instantiate objects the way it is
>>> done in an imperative language ?
>>>
>>> Thank you very much for help!
>>> Adina
>
>
Previous Topic:[ATL] refininig and parameters passing
Next Topic:Sequence Diagram to Java Code questions
Goto Forum:
  


Current Time: Tue Apr 16 10:44:30 GMT 2024

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

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

Back to the top