'Sorting' Archimate concepts

Started by JanC, August 21, 2019, 07:32:47 AM

Previous topic - Next topic

JanC

Working on reports presenting my ArchiMate models to a wider audience I am playing with Jasper including some custome templates and a few extensions to the Archi Jasper Export functionality. I have achieved my first goal ... being able to group the elements and all their documentation and properties of a view per type (Business Objects with Business Objects, Application Components with Application Components). Looking at the result I realize that I really thing that grouping per layer (Strategy, Business, Application, ...) plus Relations would suite best to most users. The reason for this post is - do others see this as a valuable feature (not only using Jasper, but any kind of documentation per view) and where to start? My initial thoughts are to extend the IArchimateConcept with a Layer property (though the name does not match really well for 'relations') and expose this property like 'Name' and 'Type'. I than would be able to sort and group by 'Layer' first - placing the Strategy elements first.

Phil Beauvoir

#1
Edit - I think you mean that you would like the elements to be grouped per type. Will investigate...
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

JanC

Phil,

I may have overlooked something. I had not (yet) seen the IBusinessObject. Thanks for the tip. I will give it a try ... and once working share the code (and Jasper template). To be continued ... .

Phil Beauvoir

#3
Jan, are you saying you want to access the elements by layer or type?

At the moment you can access elements by layer. For example:


<dataSourceExpression><![CDATA[((com.archimatetool.jasperreports.data.ArchimateModelDataSource)$P{REPORT_DATA_SOURCE}).getElementsDataSource("business")]]></dataSourceExpression>


See https://github.com/archimatetool/archi/blob/master/com.archimatetool.jasperreports/src/com/archimatetool/jasperreports/data/ElementsDataSource.java

At the code level each concept has a Java Interface that indicates its layer, and type.

See https://github.com/archimatetool/archi/tree/master/com.archimatetool.model/src/com/archimatetool/model
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

JanC


Interesting hint - I was going down the 'Group' route in Jasper.


The 'Group' route is based on fields. Thus grouping by layers would require to expose a new 'layer' field to group on. Using your suggestion instead I would need to make 7 or so Jasper bands for each layer saving me to write Java code to het a new 'layer' field exposed. I probably still need to do something as I was working on a per view basis - starting thus with the ViewChildrenDataSource instead.


I did already do some work there to group per type, using the type field (with sorting in the Archi - Jasper datasources instead of the <sortField> instruction as highlighted in the other post. The result though places the different types in alphabetical order, for example Association Relations, Application Components, Artifacts, ... so a kind of a mix up from the layer perspective.


Maybe an example will help to illustrate what I want (and where I am) . Assume an ArchiMate model with 2 Views.

View 1

Business Proces  "Do something"  ---> realized by relation --> Application Component "Component A"  --> Associated to relation --> Application Component "Component B"

View 2

Business Proces "Do something without IT" --> Flow to relation --> Business Process "Do something"   ...

I would want to see

<View 1 picture>
<Documentation of view 1>

Business Layer

Business Proces <"Do something" with all it's properties and documentation>

Application Layer
Application Component <"Component A" with all it's properties and documentation>
Application Component
<"Component B" with all it's properties and documentation>

Relations

[/size]Associate Relation <"Associated to" relation   with all it's properties and documentation>


Realize Relation <"Realized by" relation   with all it's properties and documentation>


and than View 2 similar


I think that is the most valuable 'reporting' if one looks for all details. Using some "Report:..." properties I than can hide certain details if desired - the Customizable Report gives here some very good hint.


I'm half way - I can get alle the elements (including relations) that belong to a view, but right now they are either alphabetical by name (that was already possible without code changes) or by type (for which I made some changes in code). The alphabetical order of types though mixes the layers though. So it looks right now


[/size]
<View 1 picture>
<Documentation of view 1>



Associate Relations
<"Associated to" relation   with all it's properties and documentation>
Application Components
<"Component A" with all it's properties and documentation>
<"Component B" with all it's properties and documentation>


Business Processes
<"Do something" with all it's properties and documentation>


Realization Relations
<"Realized by" relation with all it's properties and documentation>




johmut

Can you please share what code modifications you had to do to sort by type? That would already be an improvement over alphabetical order. Did you manage to do what you had in mind? and sort by layer and then by type?

rchevallier

An easy way is to define a label to the containing tree folder like "${class}: ${name}"
This lable will be applied to element's display and alphabetically sorted

rchevallier

I meant ${type} - ${name}.

IMHO, that shall avoid adding code

johmut

Great Tip ! I will go and try it out. Thanks!!

Phil Beauvoir

#9
There is already support in API to sort by type and then name in Jasper Reports export.

In the file view.jrxml change instances of

getChildElementsDataSource()
to

getChildElementsDataSourceSortedByType(true)
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.