Hello,
Today I noticed that one of my models had his “interaction::scenarios” inside a package, and not inside the “viewpoint::DRepresentationDescriptor” as expected.
Same thing happened here, remember: No error message, but Schema Image does not appear - #12 by KaBe
I quote : “BTW I didn’t knew it was possible to create a LAB on the LogicalComponentPkg”
Same happened to me today, my scenarios are inside a “CapabilityPkg”. In short :
’ viewpoint::DRepresentationDescriptor.allInstances()->select(re | re.target.oclIsKindOf(interaction::Scenario))’ does not work for one of my models, It’s because the diagrams are not inside the descriptors xml tags.
One way to know for sure where they are located would be to check the xml code or to do multiple .eContainer()'s.
In the case of the LABs on the previous post, the solution was to go get them inside the “structure” element, which was reffered at with the word : “ownedLogicalComponentPkg”. While it’s class was: “ctx… SystemComponentPkg”.
For the second case (this post), i was able to find the right reffering word. One solution was to add the prefix “owned”. I checked the simplified capella metamodel but that term (ownedAbstract…) was nowhere to be found out there. So that’s one of the tricky/difficult things to handle as a newcomer. I am not anymore, so I was able to handle it, thanks to all feedback on this forum.
Question:
Is there a way to “predict” all the places where a diagram could be “placed” in the model? (Example LAB being in LC PKG rather than the expected placement, and interaction scenario in the capability pkg rather than in the viewpoint::…descriptor)
Thanks.
-
Edit: I am trying to make a template that can be used by all kind of models, what would you suggest to me, should I consider having 2 blocs of M2DOC codes, one working for LABs located in their usual place, and ther other in the component pkg? (For Scenarios, it would be one code checking scenarios in the viewpoint::…descriptor and the other in the capability package), could there be a third place still unknown? Could they be simultaneously in both places? I know this is a very complexe question.
-
Edit2: following the same principles as the one mentioned in the previous post, this code should work right
selection.ownedArchitectures->filter(la::LogicalArchitecture).ownedAbstractCapabilityPkg.eAllContents().representationByDescriptionName(‘Exchange Scenario’)
or maybe:
selection.ownedArchitectures->filter(la::LogicalArchitecture).ownedAbstractCapabilityPkg.eAllContents().representationByDescriptionName(‘Interface Scenario’)
Inside the service we could try: (Component Interfaces Scenario) and /or (Functional Scenario), such as:
selection.ownedArchitectures->filter(la::LogicalArchitecture).eAllContents(la::CapabilityRealization).representationByDescriptionName(‘Functional Scenario’).asImage()
Nothing.
I will try again, but these trials were not successful, don’t know yet.
By the way this is my favotire place in the forum, and the less frustrating, as there is always someone available to help! Thanks again.