No error message, but Schema Image does not appear

Hello,
I am taking in account the notes/advice i was given in my last post, however in the meantime I made some tests and I don’t understand one thing.

I copied the exact template from the the Flight M2DOC example, and i made sure the gendoc was correctly configured (expert tab).

However, i am noticing that the generated document for my own project would not show the diagram for the COMPONENT BREAKDOWN. (In fight generated document does show it but not my project, although I made sure to create a Component Breakdown Diagram).
How is that possible?
The template lines of code are identical.

Here is an image to illustrate (unfortunately, my account only allows one image per post so i had to insert them all in one single image)


Thanks

Are you referencing the .aird file in the SiriusSession option of the .genconf file ?

You can also try to validate the template to see if something shows up.

Also copy/pasting from/into MS Word can change the quotes with back quotes or add spaces around quotes. But it doesn’t seem to be the case here.

You can try to list available representations and/or insert it by it’s name to test if the representation is seen by M2Doc:

''.availableRepresentations()

and/or

'[LCBD] Structure'.asImageByRepresentationName()
1 Like

Hello Yvan Lussaud,
Thanks a lot for your answer,
SeriusSession is well configured, Validating the template is successful, also i tried using the template of Inflight example to be sure i make no wrong in copy pasting.
I tried this command on M2DOC interpreter:
‘[LCBD] (nameofmyDiagramme)’.asImageByRepresentationName()

The image showed up!
But is still would not show in the generated document. I thought it might be hidden by some sort of ALT+F9 process or something, but no.
Stange no?

Good evening

Did you configure the M2Doc interpreter view with the right .genconf file ? The interpreter of the view and M2Doc should be configured exactly in the same way.

I didn’t experience this kind of issue so far… Can you put a text next to your statement inserting the diagram to see if it is present in the generated document ?

Yes, i tried both genconf I had. And both did not generate the image for the component breakdown diagram.

I inserted a text next to the image generation, and indeed it did NOT show. Check the image below (I added after the conditional (IF) “Size” and End of Text, as 2 static textes. The result is in the small orange box, but as you can see the static text (TEST) in yellow, DID show! So it seem my programm would NOT go inside the IF statement. BUT, as you can see in the image blow i DO have an LCBD (which is a logical commponent breakdown, right?)

In the green box, i tried to reproduce the line of code exaclty as the one in the template (i added the width setter), and it seems the image is way too big (if it had to be printed).

So the question is why would not the code go check inside my IF statement, if I know for a fact that I DO have an LCBD?

Thanks
Edit: To be clear, i should be seeing an image under the “TEST” yellow text and the “Size” static text.

Do you have many LogicalComponent in your model? Because the diagram should show only for the one holding the diagram.

After setting the .genconf file of your template in the M2Doc interpreter view can you select the LogicalComponent holding the diagram and try the following expression to see if the image shows up:

selection.asImageByRepresentationDescriptionName('Logical Architecture Blank')

Because I don’t understand why it doesn’t work…

Do you mean by Logical Component, Logical Architecture Blank (diagrams) actually?
Here is what i have :

  • 2 Logical Architecture Blank’s (LAB)
  • 4 Logical Components
  • A bunch of Logical Actors

    If I select the logical System, i see the loading thing under the M2DOC interpreter code, then nothing shows. Same for any logical component or actor or even clicking in an empty space inside a LAB. Same thing for clicking on any item (the one who has the engineering object thing, just under the .aird) the call function you asked me to use did not work in all these places.

Edit: I also got:

  • One LFCD (functional chain description)
  • 1 OCB
  • 1 SAB, 2 SDFB
  • 2 LAB (already mentioned), 1 LCBD (the one i wanted to show)
  • 2 LDFB
    And a number of requirements (from the add-on)

can you attach a sample project with this issue so I can have a look on my computer ?

1 Like

I made a sample project just for you (I could not share the one i was working on), but fortunaely (or unfortunately), it has the same problems,

Both SAB and Components breakdown would not show.
Template Test Problem Images.docx (24.7 KB) TestProject.afm (347 Bytes) TestProject.aird (126.3 KB) TestProject.capella (32.2 KB)
Edit: i am on CAPELLA 5.1.0 and on M2DOC 3.2.0 (added the generated doc i get) Template Test Problem Images.generated.docx (20.6 KB)

Are my lines of code wrong somehow or what? I have the same lines of code used in the In Flight LA template to display the Component breakdown diagram, yet It would not appear on mine. Were you able to make it work with C5.1 and M2DOC3.2.0 ?
Thanks

You created your diagram on the LogicalComponentPkg. It’s names “Structure” in the package explorer. So your expression should be applied on the LogicalComponentPkg and not a LogicalComponent. Or you need to create your diagrams on corresponding LogicalComponent. To access your diagrams you can do:

self.ownedArchitectures->filter(la::LogicalArchitecture).ownedLogicalComponentPkg.representationByDescriptionName('Logical Architecture Blank').asImage()
1 Like

I really should get into Ecore it seems.
I would not know when a diagramm has been created inside LogicelComponentPkg or not. And wether this:

self.eAllContents (la::LogicalComponent).isRepresentationDescriptionName(‘Logical Component Breakdown’)

or this:

self.ownedArchitectures->filter(la::LogicalArchitecture).ownedLogicalComponentPkg.representationByDescriptionName(‘Logical Architecture Blank’).asImage()

should apply or not.
Thanks for your answer YvanLussaud.

You can select the diagram and use:

selection.target

To get the element holding the diagram. You can then use the eClass() service to get its EClass:

selection.target.eClass()

BTW I didn’t knew it was possible to create a LAB on the LogicalComponentPkg.

I am glad that my questions could be beneficial in both ways for once :).

1 Like