Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Can we aggregate 2 Papyrus-RT models in a model(Building aggregate Papyrus-RT model from small Papyrus-RT components)
Can we aggregate 2 Papyrus-RT models in a model [message #1797608] Fri, 02 November 2018 16:31 Go to next message
Dimo Ditchev is currently offline Dimo DitchevFriend
Messages: 33
Registered: September 2018
Member
If we are working on a big and complex system, is it possible to decompose it into smaller components that can be developed in parallel form separate teams and integrated in a single model at a later stage.

For example, we take the PingPong example and assign the Pinger capsule to one team and the Ponger capsule to another team.
Each team creates its own Papyrus-RT model and implements the design requirements and tests them.
At the final stage both teams combine their models in a single aggregate model and test the integrated model.

Thanks,
Dimo

[Updated on: Fri, 02 November 2018 16:56]

Report message to a moderator

Re: Can we aggregate 2 Papyrus-RT models in a model [message #1797617 is a reply to message #1797608] Fri, 02 November 2018 18:16 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Well, more or less. There is incomplete support for this.

First, for the modelling part, Papyrus-RT inherits from Papyrus the concept of "sub-models" as well as cross-model references (e.g. model M1 defines capsule A, and model M2 declares a capsule part Top.a of type M1.A). In fact, cross-model references are a primitive concept in EMF, the underlying technology behind Papyrus(-RT) models.

Furthermore, to support modelling across a team, Papyrus-RT includes a model-compare (diff/merge) capability, which is essential for collaborative modelling and is integrated with EGit for version control. To use it, in the EGit perspective create or clone a git repository, save your models there, and in the Project Explorer select the model(s) to compare, right-click, select "Compare" and you have a menu of options to compare, e.g. against the previous revision, etc. This opens the Team Synchronization perspective where you can see a model-level comparison.

As for code generation, no, there is no support yet for either sub-models or cross-model references, which means that, for now at least, if you want to generate code, only one self-contained model is supported.

To deal with multiple teams working in separate models, you could try creating "harness" models that define the "environment" for the separate units, and then copy and paste the models when integrating. You can use the "Generate this capsule as top" when selecting a particular capsule, to help you testing capsules in isolation. This is obviously not ideal, but it's the only workaround while proper multi-models are supported.


Re: Can we aggregate 2 Papyrus-RT models in a model [message #1797618 is a reply to message #1797617] Fri, 02 November 2018 18:35 Go to previous messageGo to next message
Dimo Ditchev is currently offline Dimo DitchevFriend
Messages: 33
Registered: September 2018
Member
Ernesto,
Thank you
Re: Can we aggregate 2 Papyrus-RT models in a model [message #1798929 is a reply to message #1797618] Tue, 27 November 2018 14:31 Go to previous message
Nicolas Hili is currently offline Nicolas HiliFriend
Messages: 40
Registered: March 2017
Member
Hi,

To complete Ernesto's answer,
You can definitely use the concept of "sub-models" from Papyrus to decompose your implementation into smaller models that can be generated separately for testing purpose, and then composed into a larger model.

Let's assume:

  • M1 which contains a Top capsule Top1, a capsule A and whatever protocol A is using;
  • M2 which contains a Top capsule Top2, a capsule B and whatever protocol B is using.
  • M3 which contains a Top capsule Top3, and imports A, B, and the protocols used by A and B.

Top1 can be used to execute and test A (a capsule instance of type A is added to Top1). Top1 can have a simple state machine to test A.
Similarly, Top2 can be used to execute and test B (a capsule instance of type B is added to Top2). Top2 can have a simple state machine to test B.

Finally, Top3 is your top capsule of your composed model where capsule instances of A and B are added to.

The three models can be compiled separately. In order to make the composition work, be sure that:

  • For M1 (and similarly for M2), capsule A and protocols used by capsule A are included into a standalone UML-RT package located at the root of your model M1. Let us name this package P1.
  • P1 (and similarly P2) are exported (from the model explorer, choose P1, and choose "create submodel". Make sure you save your model after that. A new resource will appear in the project explorer with a blue icon).
  • Within M3, in the model explorer, choose "import package". make sure you select "copy all" (otherwise, code generation will not work). Then, create the capsule instances of A and B into Top3.

Please note that the term "copy all" is not well chosen as your model will be "linked" to the resources that were created when you did "create submodel". Therefore, any change to your capsules A and B within M3 will also affect M1 and M2.

One limitation: the above patterns assume that the protocols used by A are independent from the protocols used by B (and vice-versa). If, let's say, you want to create A and B separately (in two different modules) with A and B that share the same protocol AB (so you can connect them inside Top3), you would need to create a Papyrus model just for storing the protocol AB (otherwise you would have two protocols AB, the first one defined within P1 and imported into M3, the second one defined within P2 and imported into M3).

Please have a look at: http://flux.cs.queensu.ca/mase/papyrus-rt-resources/supporting-material-for-eclipsecon17-unconference/

The Rover model we have built was done following a modular approach where each capsule was created into a separate folder.

Nicolas Hili
Previous Topic:6 ports, 1 protocol. Send to 3 only issue
Next Topic:Java exception when generating code
Goto Forum:
  


Current Time: Wed Apr 24 23:21:27 GMT 2024

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

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

Back to the top