Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » Re: [MOFScript] Unprotected regions
Re: [MOFScript] Unprotected regions [message #380468] Sat, 24 November 2007 00:42 Go to next message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Javier,

Yes it should be possible, could you please be a bit more specific.

/G
Re: [MOFScript] Unprotected regions [message #380472 is a reply to message #380468] Mon, 26 November 2007 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: javjimgon.alum.us.es

Gøran K. Olsen escribió:
> Hello Javier,
>
> Yes it should be possible, could you please be a bit more specific.
>
> /Gøran
>
>
> "Javier Jimenez" <javjimgon@alum.us.es> wrote in message
> news:fi6ueo$g49$1@build.eclipse.org...
>> Hello ,
>>
>> it is posible to difine different unprotect section in the same file.
>> I have some problem when I regenerate.
>>
>>
>> Thanks
>>
>> Javier Jimenez
>
>
Hello,

I apologize for the first email.

I defined a set of transformation rules with different 'unprotected
regions'. With these rules I generate a code-file however in this file
all the 'unprotected' regions have the same 'number' and the same 'id'.
The problem is when I write new code in these section. If I write new
code in first section and I regenerate, the code is copied in all the
unprotected section and if I write new code in the rest of the section
when I regenerate I lose it.

Example:



self.ownedAttribute->forEach(p : uml.Property) {
' 'p.mapPropertyModifier() ' ' p.umlProperty2JavaType() ' '
p.name'; ' nl(1)

}
'
//Manual Attributes' nl(1)

unprotect{
}

....
//Generate Methods
....


' //Generate Methods' nl(1)
self.ownedOperation->forEach(o : uml.Operation){
if(!(self.name.equals(o.name))) {
' 'o.mapMethodModifier() ' ' o.mapReturnType() ' '
o.name ' (' o.mapMethodParameter() ' )' /*o.mapException()*/ '{' nl(2)

unprotect{

}

' }' nl(2)
}
}

' //Manual methods' nl(1)
unprotect{
}




Result:


// Manual Attributes

//#BlockStart number=2 id=_VO1DSI3YEdyiWvv5uxtF2A

//#BlockEnd number=2

......

//Generate Methods

void method1() {
//#BlockStart number=2 id=_VO1DSI3YEdyiWvv5uxtF2A

//#BlockEnd number=2

}


//Manual methods

//#BlockStart number=2 id=_VO1DSI3YEdyiWvv5uxtF2A

//#BlockEnd number=2
}

So my question is should be possible to define different unprotected
regions that will be independent when I generate the code. When I say
independent I mean the it is possible to write new and different code
that will not change when I generate the code again.


Thank you in advance!!
Javier Jimenez
Re: [MOFScript] Unprotected regions [message #380477 is a reply to message #380472] Mon, 26 November 2007 21:03 Go to previous message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Javier,

You are correct, it is a bug. It is caused by the generated blocks id. We
will look into it.

Cheers,
G
Re: [MOFScript] Unprotected regions [message #609667 is a reply to message #380468] Mon, 26 November 2007 10:37 Go to previous message
Eclipse UserFriend
Originally posted by: javjimgon.alum.us.es

Gøran K. Olsen escribió:
> Hello Javier,
>
> Yes it should be possible, could you please be a bit more specific.
>
> /Gøran
>
>
> "Javier Jimenez" <javjimgon@alum.us.es> wrote in message
> news:fi6ueo$g49$1@build.eclipse.org...
>> Hello ,
>>
>> it is posible to difine different unprotect section in the same file.
>> I have some problem when I regenerate.
>>
>>
>> Thanks
>>
>> Javier Jimenez
>
>
Hello,

I apologize for the first email.

I defined a set of transformation rules with different 'unprotected
regions'. With these rules I generate a code-file however in this file
all the 'unprotected' regions have the same 'number' and the same 'id'.
The problem is when I write new code in these section. If I write new
code in first section and I regenerate, the code is copied in all the
unprotected section and if I write new code in the rest of the section
when I regenerate I lose it.

Example:



self.ownedAttribute->forEach(p : uml.Property) {
' 'p.mapPropertyModifier() ' ' p.umlProperty2JavaType() ' '
p.name'; ' nl(1)

}
'
//Manual Attributes' nl(1)

unprotect{
}

....
//Generate Methods
....


' //Generate Methods' nl(1)
self.ownedOperation->forEach(o : uml.Operation){
if(!(self.name.equals(o.name))) {
' 'o.mapMethodModifier() ' ' o.mapReturnType() ' '
o.name ' (' o.mapMethodParameter() ' )' /*o.mapException()*/ '{' nl(2)

unprotect{

}

' }' nl(2)
}
}

' //Manual methods' nl(1)
unprotect{
}




Result:


// Manual Attributes

//#BlockStart number=2 id=_VO1DSI3YEdyiWvv5uxtF2A

//#BlockEnd number=2

......

//Generate Methods

void method1() {
//#BlockStart number=2 id=_VO1DSI3YEdyiWvv5uxtF2A

//#BlockEnd number=2

}


//Manual methods

//#BlockStart number=2 id=_VO1DSI3YEdyiWvv5uxtF2A

//#BlockEnd number=2
}

So my question is should be possible to define different unprotected
regions that will be independent when I generate the code. When I say
independent I mean the it is possible to write new and different code
that will not change when I generate the code again.


Thank you in advance!!
Javier Jimenez
Re: [MOFScript] Unprotected regions [message #609671 is a reply to message #380472] Mon, 26 November 2007 21:03 Go to previous message
Gøran K. Olsen is currently offline Gøran K. OlsenFriend
Messages: 184
Registered: July 2009
Senior Member
Hello Javier,

You are correct, it is a bug. It is caused by the generated blocks id. We
will look into it.

Cheers,
G
Previous Topic:[Epsilon] running the ETL sample from Java
Next Topic:[Epsilon] running the ETL sample from Java
Goto Forum:
  


Current Time: Thu Apr 25 07:48:38 GMT 2024

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

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

Back to the top