[ATL] creating objects in ATL [message #88336] |
Fri, 15 August 2008 00:05 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 #90081 is a reply to message #88381] |
Mon, 15 September 2008 05:02 |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04229 seconds