Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand]duplication problem in html report
[Xpand]duplication problem in html report [message #540825] Thu, 17 June 2010 12:58 Go to next message
Akhtar  is currently offline Akhtar Friend
Messages: 13
Registered: April 2010
Junior Member
Hi,

I am generating a html report using Xpand. I have defined different tables for package, Class and Interaction. The problem is that class table includes the value of Interaction too. here is my Xpand templates :

«IMPORT uml»
«DEFINE main FOR Model»
	«EXPAND templates::one::root»
«ENDDEFINE»

«DEFINE root FOR Model»
«FILE "test.html"»
 <H2> Table 1</H2>
  	<TABLE BORDER="1">
  		<tr>
  			<th rowspan="2" >Name</th>
  			<th>C1</th>	
	      	<th >C2</th>	
	     </tr><tr> 	
	      	«EXPAND test FOREACH eAllContents.typeSelect(Package)»		
 </tr>
 </TABLE>	
  
		
 <H2> Table 2</H2> 
 
<TABLE BORDER="1">
  		<tr>
  			<th rowspan="2" >Name</th>
	        <th >C1</th>	
	      	<th >C2</th>	
	    </tr><tr>
	      	«EXPAND test FOREACH eAllContents.typeSelect(uml::Class)»
		
	</tr>	
	</table>
	<H1>Table 3</H1> 
 
<TABLE BORDER="1">
  		<tr>
  			<th rowspan="2" >Name</th>
	        <th >C1</th>	
	      	<th >C2</th>
	      	 						
	     </tr><tr>		
			«EXPAND test FOREACH eAllContents.typeSelect(Interaction)»
	</tr>	
 </table>	
</body>
</html>
«ENDFILE»
«ENDDEFINE»



«DEFINE test FOR uml::Package »
	    <tr>
	     	  	<td>«qualifiedName»</td>
	     	  	<td>pkg value 1</td>
     			<td>pakg value 2</td>		 	
	    </tr>  	
«ENDDEFINE»	


«DEFINE test FOR uml::Class»
     	 <tr>		  
		  		<td>«qualifiedName»</td>
     			<td>Class value 1</td>
     			<td>Class value 2</td>  	
	    </tr>  	
«ENDDEFINE»


«DEFINE test FOR uml::Interaction»
     	 <tr>		  
     	 	<td>«qualifiedName»</td>
  			<td>SD value 1</td>
     		<td>SD value 2</td>
	     </tr>  	
«ENDDEFINE»


result shows SD value 1 and SD Value 2 in Interaction table as well as in Class table. My question is How can I avoid Interaction values from class table.

regards,
Akhtar

Re: [Xpand]duplication problem in html report [message #540845 is a reply to message #540825] Thu, 17 June 2010 13:32 Go to previous messageGo to next message
Christian Dietrich is currently online Christian DietrichFriend
Messages: 6536
Registered: July 2009
Senior Member
Hi,

uml:: Interaction inherits from uml::Class so you get the interactions with

eAllContents.typeSelect(uml::Class)


so you have to aditionally filter out the Interactions

e.g. like

eAllContents.typeSelect(uml::Class).reject(e|Interation.isInstance(e))
Re: [Xpand]duplication problem in html report [message #540867 is a reply to message #540845] Thu, 17 June 2010 13:57 Go to previous message
Akhtar  is currently offline Akhtar Friend
Messages: 13
Registered: April 2010
Junior Member
Thanks for the reply. It works fine with your solution.
I tried with anotherway and it works too.
eAllContents.typeSelect(uml::Class).reject(e|e.metaType == uml::Interaction)


regards,
Akhtar
Previous Topic:Accessing a set that's actually a sequence
Next Topic:In my model, Class not found or is abstract
Goto Forum:
  


Current Time: Thu Dec 18 07:18:49 GMT 2014

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

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