-
My goal is to develop a GLSP-Server with my own domain specific language. To implement this, a data model already exists as ecore. The plan is to exchange the existing ecore model and the generated code in the workflow project. With the current data model in the workflow example, there is no extra mapping needed, as I see it. As my data model is not that easy to map to the glsp-graph I need to map my data model to the glsp-graph. My question is, if that would be the correct way to proceed, as I could not find any documentation about it. Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You are on the right path! In the simple workflow example, the GModel is loaded from a JSON file and manipulated directly. Thus, there is no mapping required from the original model source (in this case the GModel itself) and the GModel that is then sent to the client. This is just to keep the example as simple as possible. In most of the actual GLSP-based diagram editor implementations that I'm aware of, the model source is not the GModel directly, but rather another resource, such as an EMF model or something else. In those cases, you need to do the following:
All operation implementations should then manipulate the original model source (EMF model). This would then re-trigger the invocation of your registered model factory to produce a new version of the GModel after every original model source update. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. I registered my custom classes.
Unfortunately I still struggle to implement these classes, are there any example implementations or is there documentation where a different model source is used than the GModel? Am I right that the following happens on start:
Thank you very very much! |
Beta Was this translation helpful? Give feedback.
You are on the right path!
In the simple workflow example, the GModel is loaded from a JSON file and manipulated directly. Thus, there is no mapping required from the original model source (in this case the GModel itself) and the GModel that is then sent to the client. This is just to keep the example as simple as possible.
In most of the actual GLSP-based diagram editor implementations that I'm aware of, the model source is not the GModel directly, but rather another resource, such as an EMF model or something else. In those cases, you need to do the following:
GModelState
class to be able to store your custom model source in a typed way and keep a mappi…