Shweta
December 17, 2021, 6:12am
1
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>
Jick
December 20, 2021, 1:30am
2
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
Shweta
December 27, 2021, 7:31am
3
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:
I want to have each relationship within a iteration for a ArchiMateCapability in separate row. Need As shown below:
Thanks in Advance
Shweta
Jick
December 28, 2021, 1:43am
4
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
Rain
January 3, 2022, 8:43am
5
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!
Shweta
January 5, 2022, 7:09am
6
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.
Expected out put is as below: