Automatic diagrams creation and objects deployment

Hi,
I would like to create automatically diagrams and deploy elements in those diagrams at the same time using a java plugin.
The elements to be deployed (with no layout) in the diagrams would be previously imported in the model, so no need to create elements at this stage.
This automatization is needed as a large number of diagrams has to be created.
How can this be done?
Thanks in advance,
Gregoire

Hi Gregoire,
Are these diagram options relevants in your case?

  • Synchronized: if a new semantic element compatible with the mapping is created (even by an action on another representation or a change in the semantic model’s file), the corresponding graphical element will automatically appear on the diagram. Symmetrically, if the semantic element of one of the mapping’s instances is deleted from the model, the graphical element (view) will disappear automatically
  • Initialization: If Initialization is set, then when the viewpoint which contains this diagram description is enabled, instances of this diagram description will be automatically created on all compatible semantic elements. (/!\ high impact on performance)
    See Sirius documentation for details:
    https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagra ms.html
    Samuel

Hi Samuel,
Thank you for your answer.
I should have been more precise in my question, I do not want to create a new kind of Sirius Diagram.
My goal is actually to create / instantiate automatically [PAB] diagrams in a Capella Model already filled with elements.
If I understand well, I need to create a new Representation using an existing Description ( = Physical Architecture Blank )
Should I use the following sirius API --> org.eclipse.sirius.business.api ?
In my case, can I use the Initialization option you mentioned ?
Gregoire

Hi Gregoire,
The initialization option may not be most appropriate in your case.
I would just create an user action triggering those steps:
for each ‘Element’

  1. create a PAB
  2. set contextual elements
  3. (option) set diagram name
  4. (option) refresh diagram
    For instance, applied to functional chains, this should automatically create this kind of diagram.
    Samuel