Diagram order in a doc generated by M2DOC

Good day all,

I’m currently using the 1.4.2 version of Capella in my company.
We have always the same problem in all our projects. This problem appears in the system analysis but also in logical analysis (I didn’t check in operational or physical level).

When I export my model with the M2DOC add-on, the order of the SAB diagram is not respected.

For example, I created three [SAB] diagrams in this order :
[SAB] Architecture n°1
[SAB] Architecture n°2
[SAB] Architecture n°3

In the project explorer, diagrams have the same order due too their name (we can’t modify the order like the functions). I checked also the order in the aird file and this is the same good order.

But when I export with M2DOC, the order changed.
It’s appeared in the document like this:
[SAB] Architecture n°2
[SAB] Architecture n°3
[SAB] Architecture n°1

If someone has any idea, I’ll very appreciate.

Thanks

Hi Damien,

To specify an order in a Set or a Sequence, you can use

Sequence->sortedBy( x | ... ) : Sequence

or

Set->sortedBy( x | ... ) : Sequence

Cf. AQL Expression for details.

BR

1 Like

Hi Samuel,

Thanks for your answer.
Do you talk about a modification of my template ?
Below You will find a part of the template concerning the diagram. Could you help me to add the right information ?

Thanks

Damien
image

You can add the sort in the last for:

...->select(rep | rep.isVisibleInDoc())->sortedBy(rep | rep.name)

Hi Yvan,

It’s perfect ! You solved my problem !

Thanks a lot

Damien

1 Like