import logical function and component breakdown structuress

Hi,
I found a lot of questions about it in the previous forums but no answer :frowning:
How to import massive data in Capella (such as logical function breakdown structures or logical component breakdown structures) coming from csv files (or xml files)?
thank you
david

Hi,
I found a lot of questions about it in the previous forums but no answer :frowning:
How to import massive data in Capella (such as logical function breakdown structures or logical component breakdown structures) coming from csv files (or xml files)?
thank you
david

Hi David,
I don’t think there is a ready to use solution for this at the moment.
We can provide you some professional services to acheive this though.
Stephane

Hi David,
I don’t think there is a ready to use solution for this at the moment.
We can provide you some professional services to acheive this though.
Stephane

Capella Groovy is great for such tedious tasks. A little groovy programming knowledge is required though. Maybe we can add your use case to the zoo of examples that are already available, but you’d need to be a little more specific on how your csv/xml files would look like.

Capella Groovy is great for such tedious tasks. A little groovy programming knowledge is required though. Maybe we can add your use case to the zoo of examples that are already available, but you’d need to be a little more specific on how your csv/xml files would look like.

Maybe it’s even simpler than that… If you say you have an xml file, look at the “capella” xml file format, here’s an example for a bunch of logical functions:
If you can produce something like this, you could simply insert this into the capellamodeller file at the right location? You can even save such a file as a .capellamodeller file, and in Capella right click and “Open With… Capellamodeller Model Editor”. Noone ever uses that editor but it’s good to know it exists… In that editor you can then load your ‘real’ capella model with right-click “Load Resource…”, select your original .capellamodeller file and they you can just copy paste your functions into the model and save. Maybe there’s hickups with this approach, but surely it’s worth a try. Make sure to backup your original model beforehand and then maybe use Capella GIT integration to verify the changes to your original model.

Maybe it’s even simpler than that… If you say you have an xml file, look at the “capella” xml file format, here’s an example for a bunch of logical functions:
If you can produce something like this, you could simply insert this into the capellamodeller file at the right location? You can even save such a file as a .capellamodeller file, and in Capella right click and “Open With… Capellamodeller Model Editor”. Noone ever uses that editor but it’s good to know it exists… In that editor you can then load your ‘real’ capella model with right-click “Load Resource…”, select your original .capellamodeller file and they you can just copy paste your functions into the model and save. Maybe there’s hickups with this approach, but surely it’s worth a try. Make sure to backup your original model beforehand and then maybe use Capella GIT integration to verify the changes to your original model.

Hi Felix,
Thank you for your last suggestion. It works!
nethertheless, it is to be carefull with the compliancy of the xml file with capella model structure, but it is possible to do very interesting things with the capellamodeller…
Unfortunately, i don’t know what is Capella Groovy? can you give me more information?
we keep in touch,
david

Hi Felix,
Thank you for your last suggestion. It works!
nethertheless, it is to be carefull with the compliancy of the xml file with capella model structure, but it is possible to do very interesting things with the capellamodeller…
Unfortunately, i don’t know what is Capella Groovy? can you give me more information?
we keep in touch,
david

David, yes, you need to be careful with the capellamodeller editor. It is not fully functional. It lets you do things that capella does not allow. It also does not show the derived properties of objects, e.g. LogicalFunction.realizedSystemFunctions. Always make backups and compare/review changes via git/source control.
Capella Groovy is an addon to Capella that allows you to work on capella models with groovy scripts.
There is a
basic example. And
another example that exports some elements as csv. The cool thing about this one is that you don’t even need to download csv libraries. Groovy will do this automatically by looking at the @Grab instructions in the script itself.
The sad thing is that there is no funding whatsoever. It is 100% my voluntary work. I will only contribute free fixes and features as I have time and joy of doing it. I have both at this moment. If you’re interested, I’ll setup a small wiki page to explain installation, which at this moment is a bit more complicated than it should be, because of this Eclipse
bug.

I just edited
https://github.com/eclipse/capella-tools/wiki to explain the installation shortly.

Hi Felix,
Is there a place where I can look to install Groovy4Capella for Capella 1.4.0?
Also what would be your advice/favorite resource to learn groovy quikly.
Thanks
Stephane

Stephane, the instructions at https://github.com/eclipse/capella-tools/wiki should also apply for Capella 1.4.0. As for learning Groovy, if you know Java you’re already there. Valid Java is also valid Groovy. Maybe it’s best to learn by example, look at the Capella Groovy Examples and try to understand them…