Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Polarsys » M2Doc » State Fragments are doubled(When trying to get the list in an Exchange Scenario)
State Fragments are doubled [message #1819056] Mon, 06 January 2020 13:54 Go to next message
Mathias Cocheri is currently offline Mathias CocheriFriend
Messages: 21
Registered: December 2019
Junior Member
Hello,

I tried to retrieve the list of functions used in an Exchanged Scenario Diagram, but the functions are doubled in the result of the aql expression I'm using:

(self being a Scenario - Exchange Scenario, not the diagram itself)

aql: self.ownedInteractionFragments->filter(interaction::InteractionState)

Result:
InteractionState 1
InteractionState 1
InteractionState 2
InteractionState 2
InteractionState 3
InteractionState 3
.... etc

index.php/fa/37091/0/

Note that InteractionState with the same name have a different id, but point toward the same Function:

index.php/fa/37092/0/

index.php/fa/37093/0/

Is it expected to have twice the number of State Fragment in the model ?
  • Attachment: Error.PNG
    (Size: 23.33KB, Downloaded 274 times)
  • Attachment: Error2.PNG
    (Size: 7.08KB, Downloaded 226 times)
  • Attachment: Error3.PNG
    (Size: 8.79KB, Downloaded 226 times)
Re: State Fragments are doubled [message #1819119 is a reply to message #1819056] Wed, 08 January 2020 09:06 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 63
Registered: July 2009
Member
For the model question I have no clue.
But to remove duplicates from you expression you can use ->asOrderedSet() for instance:

self.ownedInteractionFragments->filter(interaction::InteractionState).relatedAbstractFunction->asOrderedSet()
Re: State Fragments are doubled [message #1819123 is a reply to message #1819119] Wed, 08 January 2020 12:16 Go to previous messageGo to next message
Mathias Cocheri is currently offline Mathias CocheriFriend
Messages: 21
Registered: December 2019
Junior Member
I figured what was the issue.

While I don't know what those "Interaction States" are, the elements I was looking for were actually "StateFragment", which are not duplicated.

scenario2.eAllContents()->filter(interaction::StateFragment)


But thanks anyway, I had no idea that "asOrderedSet" was removing the duplicates !
Re: State Fragments are doubled [message #1819144 is a reply to message #1819123] Wed, 08 January 2020 18:10 Go to previous message
Stephane LACRAMPE is currently offline Stephane LACRAMPEFriend
Messages: 217
Registered: July 2009
Senior Member
Mathias,
If that helps, you'll find in the embedded Capella help a complete reference of the Acceleo Query Language used in M2Doc.
Stéphane


Stephane LACRAMPE
Obeo Canada
Previous Topic:List of Referencing Elements
Next Topic:Class Diagrams
Goto Forum:
  


Current Time: Tue Apr 23 17:00:33 GMT 2024

Powered by FUDForum. Page generated in 0.03033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top