Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Xtext in Papyrus RT RCP
Xtext in Papyrus RT RCP [message #1841646] Mon, 24 May 2021 15:31 Go to next message
Tomas Wall is currently offline Tomas WallFriend
Messages: 53
Registered: April 2021
Member
Hello,

I have download Papyrus RT RCP, as it looked like the fastest way to get it up and running. However, I want to ask if I can use Xtext in Papyrus RT RCP, or I should try to install Papyrus RT in Eclipse in order to be able to use both?

Thank you!
Re: Xtext in Papyrus RT RCP [message #1841649 is a reply to message #1841646] Mon, 24 May 2021 16:25 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Hi. Xtext is already installed with Papyrus-RT, or at least the runtime, since Papyrus-RT includes textual syntax for UML-RT, although it was not made public as part of the official release. If you are interested, you can edit plain text files with the .umlrt extension and get full support, even converting back and forth between graphical and textual notations.

Nevertheless, the Xtext included is an older version, as Papyrus-RT was released with Eclipse Oxygen, but I don't think it includes the full Xtext SDK, which you would need if you want to develop your own languages. You can install the full Xtext SDK, but I don't know if the most recent versions are compatible. The one used in Papyrus-RT was Xtext 2.12 (the latest is 2.25). So you can try installing a more recent version and if it fails (very likely), revert to 2.12.

I do not recommend installing Papyrus-RT on top of an existing Eclipse installation. It will not work with versions more recent than Eclipse Oxygen, and due to changes in some dependencies, specially Papyrus, the update site is unlikely to work.
Re: Xtext in Papyrus RT RCP [message #1841650 is a reply to message #1841649] Mon, 24 May 2021 16:52 Go to previous messageGo to next message
Tomas Wall is currently offline Tomas WallFriend
Messages: 53
Registered: April 2021
Member
No Message Body

[Updated on: Tue, 25 May 2021 14:12]

Report message to a moderator

Re: Xtext in Papyrus RT RCP [message #1841670 is a reply to message #1841650] Tue, 25 May 2021 12:43 Go to previous messageGo to next message
Tomas Wall is currently offline Tomas WallFriend
Messages: 53
Registered: April 2021
Member
No Message Body

[Updated on: Tue, 25 May 2021 14:12]

Report message to a moderator

Re: Xtext in Papyrus RT RCP [message #1841678 is a reply to message #1841649] Tue, 25 May 2021 14:23 Go to previous messageGo to next message
Tomas Wall is currently offline Tomas WallFriend
Messages: 53
Registered: April 2021
Member
Hi Ernesto,

I tried the textual syntax and I also tried to transform textual to graphical and vice versa (it works so far).

I am trying to use Papyrus RT with ETL. I wrote some simple transformation rules, but when it comes to picking out the source and target model and corresponding metamodel, I do not get anything when I press Add....
So first what type of model should I choose for the textual and graphical model? These are the possible options

https://ibb.co/WtQrSyd
Check this link for the image if it doesn't show up here https://ibb.co/WtQrSyd

My first guess is that I could find them in the registered Packages, but there are quite many and I am not really sure which one is the correct one.

[Updated on: Tue, 25 May 2021 14:24]

Report message to a moderator

Re: Xtext in Papyrus RT RCP [message #1841688 is a reply to message #1841650] Tue, 25 May 2021 18:21 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
I'm not sure how you are replying to the messages, but in the forum your messages appear only as "No Message Body". I only see your messages on e-mail. Perhaps you are using some formatting? I'd suggest setting HTML to off in your Eclipse Forum settings.

I'm reproducing your first reply I got here for other people to see:

Tomas Wall wrote on Mon, 24 May 2021 12:52

Hi Ernesto, thank you for your answer. Just a few quick questions:
1. How could I convert between graphical and textual notations? (I cannot find that information online)
2. By installing Xtext SDK (at least), 2.12 would I be able to develop my own language?
3. Does Papyrus-RT RCP support transformation languages such as Xtend, EGL, or ETL?
Thank you!


1. It looks like from a subsequent message you figured out part of this. There is no documentation online because as I said in my original message, it is not an official part of Papyrus-RT, only an experimental feature which was not made public. In the 1.0 release, when you right-click on a .umlrt file in the "Project Explorer" you'll see a menu o option titled "Generate Papyrus UML-RT model from textual model (experimental)". This option does exactly what it says, so you get a graphical view of the model. Of course the diagrams are not very good so you have to do proper layout manually. For the other direction there is a menu option "Transform Papyrus UML-RT model to textual model (experimental)" when you right-click on a Papyrus .uml file, but it is buggy. Nevertheless, the transformation is implemented in the code base.

2. Yes, that's what the Xtext SDK (Software Development Kit) is for, as opposed to the Xtext runtime.

3. I'm not sure what you mean by "support transformation languages". If you mean that is it possible to use transformation languages such as the ones listed to create model transformations of Papyrus-RT model, the answer is that yes, as long as the transformation language understands EMF models. In fact, Papyrus-RT implements both code generation and graphical-to-textual and textual-to-graphical using Xtend2.

See the answer in Message #1838584 that describes the underlying meta-model (UML2 + Profile + UMLRT façade) and the intermediate meta-model (XtUMLRT), and also includes a link to the textual syntax reference.

Note, the address of the git repo in that message doesn't seem to be available any more, but this one is: https://git.eclipse.org/c/papyrus-rt/org.eclipse.papyrus-rt.git/.




[Updated on: Tue, 25 May 2021 18:33]

Report message to a moderator

Re: Xtext in Papyrus RT RCP [message #1841689 is a reply to message #1841670] Tue, 25 May 2021 18:32 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Tomas Wall wrote on Tue, 25 May 2021 08:43
I think I found where I can go from a graphical to a textual model. On the uml file I right-click and then click Transform Papyrus UML-RT model to textual model. Correct me if I am wrong.
However the PingPong.umlrt file that is generated is empty. Is there an error from my side or is this not working correctly in the first place?

Many thanks!


You found it. It used to work in the pre-release, but probably there is a bug that prevents it from working correctly. As I said, this is not an official feature, only experimental.

You are welcome to check the git repo at https://git.eclipse.org/c/papyrus-rt/org.eclipse.papyrus-rt.git/. The transformations are implemented under "plugins/xtumlrt/trans".


Re: Xtext in Papyrus RT RCP [message #1841693 is a reply to message #1841678] Tue, 25 May 2021 19:07 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Tomas Wall wrote on Tue, 25 May 2021 10:23
Hi Ernesto,

I tried the textual syntax and I also tried to transform textual to graphical and vice versa (it works so far).

I am trying to use Papyrus RT with ETL. I wrote some simple transformation rules, but when it comes to picking out the source and target model and corresponding metamodel, I do not get anything when I press Add....
So first what type of model should I choose for the textual and graphical model? These are the possible options

https://ibb.co/WtQrSyd
Check this link for the image if it doesn't show up here https://ibb.co/WtQrSyd

My first guess is that I could find them in the registered Packages, but there are quite many and I am not really sure which one is the correct one.


I am not familiar with ETL and I don't know which "Add..." button you are talking about. But if I'm not mistaken, I understand that ETL can manipulate EMF models. If this is so, the input could be either:

1) The UML2 model
2) The XtUMLRT model (this is the intermediate representation used by code generation and the textual syntax)
3) The UML-RT façade (a custom interface that makes UML2 models look like UML-RT models)

A UML2 model is of course an EMF model, so ETL should be able to handle it. The drawback is that it doesn't know about the specifics of UML-RT, so you might have to do more work.

For #2, you'll need to access objects defined by the XtUMLRT meta-model (which knows about UML-RT) defined in the git repo under plugins/xtumlrt/metamodel. But since a UML-RT model is persisted either as a .uml file (which stores a UML2 model) or as a .umlrt file, then such file should be first loaded into memory and transformed into XtUMLRT. If the file is a .uml file, the transformation is defined under "plugins/xtumlrt/trans/org.eclipse.papyrusrt.xtumlrt.trans.from.uml". If the file is a .umlrt file, then no transformation is needed, as XtUMLRT is the metamodel for textual syntax, so parsing the .umlrt file will result in such model.

For #3, you also need to load the .uml file, but no transformation is required. Rather, the in-memory UML2 object can be accessed using the UMLRT façade defined in "plugins/umlrt/profile" which give a UMLRT interface to the UML2 objects.

If the screenshot you sent is a widget from ETL allowing you to select the source metamodel of a transformation, it looks like it would be UML, but as I said, I'm not familiar with ETL. You are on your own there.

Previous Topic:Required feature "upperBound" and "lowerBound" must be set
Next Topic:Q about structure of ISO 80000 and QUDV in SysML Papyrus and how to apply it.
Goto Forum:
  


Current Time: Mon Apr 29 12:08:31 GMT 2024

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

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

Back to the top