Skip to main content



      Home
Home » Modeling » ATL » genereted code error
genereted code error [message #947662] Wed, 17 October 2012 05:45 Go to next message
Eclipse UserFriend
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 05:51] by Moderator

Re: genereted code error [message #947769 is a reply to message #947662] Wed, 17 October 2012 08:19 Go to previous messageGo to next message
Eclipse UserFriend
please reply me
Re: genereted code error [message #954191 is a reply to message #947769] Mon, 22 October 2012 17:24 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 19:05:23 EDT 2025

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

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

Back to the top