Mass views exports

Hello
My question is more enhancement request to tool makers:
Currently I use many csv export to analyze my model and I have several concerns:

  1. All views are forgotten when exiting the tool, so you need to perform again the selection. I exports have each time the same criteria: I need functions; functional exchanges Exchange Items; Modes; Capabilities…
    When selecting, I have to select at once items to be sent in several views, by short lists du to their position in the tree: examples: capabilities; scenarios; function instances or function and functional exchanges. I would like to have a way to show them all together for selection.
    The second choice would be to prepare a doc template, but then I would have to convert all tables to Excel to apply data checks (or Access)
    All this is related to:
    Check exchange item nature (which is set as property value group to allocating exchange category)
    Check justification of allocation: EI is used in one IS at least relating to interface and invoked exchange
    Track state and mode attribution while crossing Arcadia process from Mission; Capabilities to Component Behavior
    Track variant (applied property value group) from applying to function instance; scenario; capabilities; functions; allocating components (Value and attributes)
    Track generalization of EI values used in scenarios to signals through typing and generalization, track distribution of instances for EI related to multiple instanced function/components.
    At the moment I exporting 24 different tables for all this, just for system analysis.
    Thanks for any information
    Regards

Thierry Poupon

I think document generation might not be the best solution for what I understood of your need. You could generate a document and have an human review it for validation but it seems tedious depending on the size of your model.

A better approach would be to implement validation rules inside of Capella. For more details please use the general section of this forum. This will give you feedback inside of Capella which is nice for people editing the Capella model.

An other approach could also be to create an external tool for batch validation for instance with Python4Capella. Python4Capella could also be used to create your csv/xlsx exports.

And for Capella improvements you should probably post your question in the main section of this forum.

Thanks Yvan
About validation rules, I explored available checks and could not find anything about EI nature (digital/analog/mechanical power/ airflow…) which is consistent because it’s not in standard metamodel. I could not find how to create rule either.
So to keep my rules in tool, I have to learn python… and python4capella then.
Thierry Poupon

The idea is to develop your own validation rule with the above extension point.

And also ask your question in the more generic section of this forum. Some people might have a better idea than I did :slight_smile:

Hi,
Some news: I have managed to get versions in line to make python4capella run…
I managed to adapt to my model the sample script to export capabilities and owned scenarios… It runs, I still have to adapt loops because I like tables not indented lists, and then I have only 2 columns. This is where I’m worried: to fill out 673 cells, it needed almost 10 minutes, my target is to get a similar table as a manual export of mass visualization with all columns, and do it for functions, function instances, components, exchange items, functional exchanges, scenarios, component exchanges, physical links, modes in several machines, classes, data details, missions, repeat for each layer…
Any idea to speed up?
Thanks by advance
Regards
Thierry Poupon

Hi,

It seems weird that performances are not better than this. I personally work on some big-enough models and big spreadsheets (about 30k lines and 10’s of columns) and it does parses and runs correctly. What takes most of the time is to print in the console view.

Algorithmically speaking, in order to retrieve your model elements, do you use the get_all_contents_by_type() function on the SystemEngineering or maybe on each layer element ?

Because, if you use this method to get all:

This means (dozens of types * number of layers) complete model browsing (because of get_all_contents_by_type()) which may indeed take some time. Can you try to analyze your code with regards to this to get an estimate of how many times you do browse your model ?

One way to improve this may be to do one browsing and store interesting elements in different local variables (maybe one for each tables you export) and then to do the display/export of your tables ?

I’m wondering if performances are different depending on the interpreter you use (see Window/Preferences/PyDev/Interpreters).

image

Did you try to compare performances when launching using different engines ? (You can change it in the run configuration).

Regards,
Arnaud

Thanks Arnaud, I will try other engines…; but for the moment I struggling to get tables instead of indented list. The script sample I tried is listing capabilities, and indents scenarios in second column, splitting the list by rows.
I would like to have the scenario in one cell, separated by tab as mentioned in my csv setting, in second column. I would do the split by row by Excel, using the query functions. At the moment the question is how to get other attributes than name of an item. I did not find syntax indication about this (the orginal script looks for scenario item names)
I don’t expect to be able to bring all my model analysis in the workbench, then I will need to prepare tables for Excel analysis… (In fact I did not understand were was the opportunity to create a check. For some, I have to setup a list of allowed combinations, and check if found ones are in.

Thanks again for your help.

Edit1: Just reviewing help information: how to use AQL? Do I need any plug-in to run AQL queries? Where can write them? Is it possible to issue a csv or xlsx from the result?

Hello @Thierry_Poupon ,
Are you looking for this type of table ?
Capability 1 | Scenario 1
Capability 2 | (no scenario)
Capability 3 | Scenario 2

The documentation of the simplified metamodel used as specification for Python4Capella is here (word and model), introduced in this video : with this you can see which are the attributes, relations and methods defined for instance for a type Capability

Concerning the checking aspect thanks to queries, maybe this new sample script example can interest you.

Best regards,

Sophie

1 Like

Thanks Sophie
Looks like tables I’m looking for…
Today I exporting 20 tables to csv, save them to xlsx. Then I have several excel workbooks doing non semantic model analysis and report issues.
First priority, I’m looking for automation in selecting items and send them to mass view, then exporting data, perform tests (but these occur already in my workbooks).
I will visit this new script…
Regards
Thierry

Edit 1:
I manage to adapt to my model (at the moment it stops at the end of system analysis):
I understand the result is a matrix SFxLF with a X where the LF is realized by the SF.
So it’s similar then to standard matrix we can ask for within the tool.
I’m looking for automate the item selection and send them to a mass view, or use another way to get the csv or better the xlsx export of this mass view done.
Most painful are: export mass view of all system functional exchanges (mixed in functional tree) or export mass view of modes or states of a state machine (regions and transitions are mixed). Some other are easier because you can filter the other class mixed in the tree.
Thanks for your time
Regards
Thierry

Hello @Thierry_Poupon,
Concerning the item selection, this video tutorial by @ArnaudDieumegard could interest you. Could you tell more about your need of automation of the item selection ?
The item selection combined with a adaptation of this new sample script about export Functional exchanges and System Functions could help you with the export of system functional exchanges.

Best regards,

Sophie

Thanks Sophie for your response
About SFE: each of them is given a category, and exchange items apply a property value group that describes the dimension/domain of the exchange. My current exports compare both and a static list says when the SFE category and the EI PVG are relevant. The purpose is avoid transmitting electronic message by an aeraulic hose. I check as well that flows are not mixed in same SFE with other mechanisms. I check if EI are detailed in classes and detailed types…
I check justification of EI in SFE/SI by the matrix Interface x Capabilities
I have other checks concerning life phases (states) supported by modes, relation to capabilities and functions.
Capabilities, functions, function instances, scenarios, components apply other PVG describing variants: I check consistency and opportunity for logical function split…
To do it all I need the list of all SFE in a mass view or other table (mixed in the tree with functions); OEI and SEI tables; interfaces; SF; Modes (mixed with regions and transitions) and I manage to avoid needing ports by giving a suffix to SF applied to ports.
Selecting System Functional Scenarios; System Function Instances; System Function Exchanges or Modes is really long. Mode is bigger again, because my perceived system is really bigger than my system of interest, which governs modes for most of the perceived system: I have 1 MSM for the perceived system lifecycle, on 2 MSM for modes for both perceived system (includes some of actors) and system.
(There is no model for the perceived system, and this is not in my customer’s scope, and he is already drastically overloaded. That’s why he will need more automation and less modeling action to check and update model)

Hello @Thierry_Poupon ,
Thanks for this explanation.
Concerning the automation of the item selection, you can also run script without selecting elements for exemple with the

Does it fit more with your need of mass export of FE and System Functions (in table) ?

Best regards,

Sophie

I’m progressing… but I’m thinking to another point: Today I’m using tables issues from mass views, where a cell can be filled by several response. My Excel work does the appropriate split in row for further data analysis and joint. But I do the split only where needed. This kind of matrix does it at first. This means the wider is my matrix, the longer it will be immediately (I have 120 capabilities using 80 functions in system and 20 actors, some of the capabilities own several scenarios multiplied by the transformations, and there are 1300 EI in my model. This will change the way I have to design my checks: use many narrow data, kind of link list only… For this process, it’s day one again!
Thanks again for your time :slight_smile:
Thierry

Thanks for your feedback.
By the way, if you would like to share a sample script, you could do it here : python4capella/plugins/Python4Capella/sample_scripts at master · labs4capella/python4capella · GitHub

Concerning your checks, maybe you can perform some checks directly into the script (for exemple for EI) and export the result into excel, as an alternative to mass export ?

Best regards,

Sophie

If you need to export with Python4Capella without split in row, maybe this script can be useful

Thanks Sophie
I just tried to adapt SFE linking SF… I got the full cartesian square of the complete system function tree (including parents) : 9025 rows! but no FE were found except 2…
I have to consider developing a new model analysis system: use many narrow tables…
How could I filter rows: example keep only leaf functions? more general question: is there any syntax guide for EASE or python4Capella?
Thanks again
Regards
Thierry

Hello,
What was the type of modification ?
Concerning the syntax guide, does this extract of a demo, performed in the webinar by @ArnaudDieumegard help you in complement of the metamodel documentation & model ?

Best regards,

Sophie

Hi Sophie,
I was trying another one: allocation EI to FE it seems to run but overflows memory.

I have 1300 EIs in my model, and about 300 FE. I wonder if sometimes, we create the full cartesian product: 400 000 rows!
Excel is supposed to run 1M rows sheets, but…

Hi Sophie,
I’m building a new model analysis system with reduces tables:
I managed to set from given example capabilities and system scenarios, from which I check wether SFS number equals SIS number on the Excel side
Then I managed to get SFE and their category, and the same with the allocated EI…
Now I’m working on the exchange item list: what I’m facing to is that ExchangeItem seems not to have any ExchangeMechanism… The next step will be to take the applied PVG where is mentioned the nature of the exchange.
Is there any spelling hack with the exchange mechanism or is it due to the fact is an enumeration? I did not set a loop for that one, because it accepts only one content. This may be my next try to have one…
Thanks for any help.

Hello @Thierry_Poupon ,
Indeed, “Get_exchange_mechanism” is KO (cf p207/284 of M2Doc generation of the simplified metamodel)
You can open an issue if you want : Issues · labs4capella/python4capella · GitHub

Best regards,

Sophie