Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » genereted code error
genereted code error [message #947662] Wed, 17 October 2012 09:45 Go to next message
dorraaaa Z is currently offline dorraaaa Z
Messages: 22
Registered: June 2012
Junior Member
hi
I have this generated code
<UIML:StructureType>
<part class="G:TopContainer" id="SuiviSysteme" name="SuiviSysteme"/>
</UIML:StructureType>
<UIML:PartType class="G:Area" id='connection' name='connection'/>
<UIML:PartType class="G:Text" id='login' name='login'/>
<UIML:PartType class="G:Text" id='pwd' name='pwd'/>

But I want to have a generated code like this

<UIML:Structure>
<part class="G:TopContainer" id='SuiviSysteme' name='SuiviSysteme' >
<part class="G:Area" id='002' name='connection' >
<UIML:PartType class="G:Text" id='login' name='login'/>
<UIML:PartType class="G:Text" id='pwd' name='pwd'/>
</part>
</part>
</UIML:Structure>

How can i change to have the second structure
please help me to find the problem

my code is:

rule UIMLStructureFromTaskModel {
from
tskMdl : CTT!TaskModelType
to
structure : UIML!StructureType ,
part : UIML!PartType
do{
structure.part <- part ;
part.class <- 'G:TopContainer';
part.id <- tskMdl.nameTaskModelID;
part.name <- tskMdl.nameTaskModelID;
} }

rule UIMLStructureFromTask{
from
task : CTT!Task
to
partTask : UIML!PartType
do{
if (task.TypeIE='UIFieldInManual' ){
partTask.class<- 'G:Text';
partTask.id<-task.identifier;
partTask.name <-task.name;}
else{
partTask.class<- 'G:Area';
partTask.id <- task.identifier;
partTask.name <-task.name;}}}

[Updated on: Wed, 17 October 2012 09:51]

Report message to a moderator

Re: genereted code error [message #947769 is a reply to message #947662] Wed, 17 October 2012 12:19 Go to previous messageGo to next message
dorraaaa Z is currently offline dorraaaa Z
Messages: 22
Registered: June 2012
Junior Member
please reply me
Re: genereted code error [message #954191 is a reply to message #947769] Mon, 22 October 2012 21:24 Go to previous message
Ronan B is currently offline Ronan B
Messages: 244
Registered: July 2009
Senior Member
Hi,
You should consider re-writting your rules. The do section should only be used as a last resort. You need a to section in the UIMLStructureFromTaskModel matched rule which assigns the appropriate UIML!PartType to the part attribute on UIML!StructureType.

Try rewritting the rules without a do section and you will get the result you want with easier to read code.

Regards,
Ronan
Previous Topic:method
Next Topic:write sequence
Goto Forum:
  


Current Time: Wed Oct 01 04:15:38 GMT 2014

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

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