How to Generate ForEachSimpleRelationship each in a separate Row in a table

How can I get the values of ForEachSimpleRelationship iteration in a separate TableRow?
With the below code snippet, I get runtimeException viz:
"java.lang.RuntimeException: tableBlock> cannot contain the content (e.g ) without TableRow> & tableCell>"

Code Snippet:-


													<TableCell >
							                                         <Property property="name" fontSize="8" style="Normal"/>
							                                 </TableCell>	
										               <TableCell>   	
												
													<ModelElementProperty property="from">
													
														
														     <Property property="name" fontSize="8" style="Normal"/>
														    <Text>, </Text>
															</ModelElementProperty>
												   </TableCell>
									
							                     </TableRow>	
											  
											</ForEachSimpleRelationship>
										</HasRelationshipChecker>

Hi Shweta,

Thank you for your post. Do you mean you want to create one table per simple relationship? The code you included is incomplete. Would you mind re-including a more completed version of the XML?

Best regards,
Jick Yeung

Hi Jick,

I don’t want to create one table per relationship, instead want to have one row per relationship.

Here is the code which I am using.
template_xml_code.xml (3.4 KB)

The result with the above code is that, it groups all the relationship iteration for a ArchiMateCapability in one row. As shown below:
image

I want to have each relationship within a iteration for a ArchiMateCapability in separate row. Need As shown below:
image

Thanks in Advance

Shweta

Hi Shweta,

Thank you for your post. I have forwarded your question to our team for further studying. When there is any news, I will let you know.

Best regards,
Jick Yeung

Hi Shweta,

You may change the loop as example below to output one relationship per row.

       <IterationBlock allLevel="true" modelType="ArchiMateCapability">  
		<HasRelationshipChecker modelType="ArchiMateUsedBy" direction="to">
			<ForEachSimpleRelationship type="ArchiMateUsedBy" ignoreLastSeparator="true">
				<TableRow>
					<TableCell>
						<ModelElementProperty property="to">
							<Property property="name" fontSize="8" style="Normal"/>
						</ModelElementProperty>
					</TableCell>
					<TableCell>
						<ModelElementProperty property="from">
							<Property property="name" fontSize="8" style="Normal"/>
							<Text>, </Text>
						</ModelElementProperty>
					</TableCell>
				</TableRow>
			</ForEachSimpleRelationship>
		</HasRelationshipChecker>
		<HasRelationshipChecker modelType="ArchiMateUsedBy" direction="from">
			<ForEachSimpleRelationship type="ArchiMateUsedBy" ignoreLastSeparator="true">
				<TableRow>
					<TableCell>
						<ModelElementProperty property="from">
							<Property property="name" fontSize="8" style="Normal"/>
						</ModelElementProperty>
					</TableCell>
					<TableCell>
						<ModelElementProperty property="to">
							<Property property="name" fontSize="8" style="Normal"/>
							<Text>, </Text>
						</ModelElementProperty>
					</TableCell>
				</TableRow>			
			</ForEachSimpleRelationship>
		</HasRelationshipChecker>	
	</IterationBlock>

Hope this help!

Thanks Rain…

If I want to put a ParentModel of the ModelElementProperty in a separate Table cell, how that can be done?
Also is it posible to save the ParentModel’s value in a variable. That way when the model element block gets executed, I can then create a table cell & get the value from the parent model’s variable in a separate column.

image
Expected out put is as below:
image