Replies: 14 comments
-
Assuming that you have the typehints case nodes correctly this should work and the correct containerID (i.e. the id of the casenode) should be picked up. So maybe double check if your typehints are correct. If it's still not working I can checkout the code later today |
Beta Was this translation helpful? Give feedback.
-
[simongraband] I already thought about the TypeHints and this would also be a follow up question i had. What exactly is the reparentable attribute? May this be connected to this?
|
Beta Was this translation helpful? Give feedback.
-
At first glance this looks correct. Reparentable describes wehter a child element can be moved from one container to another. This should not affect the element creation. |
Beta Was this translation helpful? Give feedback.
-
[simongraband] Should the TypeHints prevent elements from being created? So would the TypeHints above block a Stage from being created on a plain Graph (since it is not defined in the List)? Or does this require additional Code? Because if it should block it, this is also not working for me. |
Beta Was this translation helpful? Give feedback.
-
[simongraband] I think what might cause this behavior. In the method Should all the methods in the CMMNFacade still have EObjects as parameters or should it be CMMNElements? |
Beta Was this translation helpful? Give feedback.
-
CMMNElements are inheriting from EObject so this should be fine |
Beta Was this translation helpful? Give feedback.
-
[simongraband] The problem is that the CMMNElements for some reason do not have the eContainer attribute initialized. This leads to problems with the URI creation in ResourceImpl. But as far as i know i create the CMMN Elements in the same way as the ecore elements are created. Is there an additional step that needs to be done? |
Beta Was this translation helpful? Give feedback.
-
Sounds to me like you did not set the 'Containment' property to 'true' for your CMMN Elements reference. |
Beta Was this translation helpful? Give feedback.
-
[simongraband] I updated this and it seems to have fixed the problem with the URI. However the containerID of the Operation is still always the ID of the Graph and not the selected node. Could there be some problem with the client? So that the client has trouble recognizing the right element? |
Beta Was this translation helpful? Give feedback.
-
Hmn, we never had problems like that in any of the other projects and it seems to work fine in ecore-glsp, so I don't think it's a client issue. Could you push your current state? Then I can have a look |
Beta Was this translation helpful? Give feedback.
-
[simongraband] I pushed my changes (https://github.com/simongraband/cmmn-editor). The code that prevents the nodes from being created in |
Beta Was this translation helpful? Give feedback.
-
You never request the typehints from the server. That's why the default behavior is active (every node can be created everywhere). You have to dispatch a |
Beta Was this translation helpful? Give feedback.
-
[simongraband] Thanks a lot that fixed it :) I just have one more related question: What would be the best way to ensure that the newly created |
Beta Was this translation helpful? Give feedback.
-
That's an interesting question, I think that usecase is not covered in GLSP yet. For an easy, straight-forward solution you could probably bind an |
Beta Was this translation helpful? Give feedback.
-
I am trying to restrict where an element in the model can be created for my cmmn-editor. More precisely i want
Stage
-Nodes to only be created if aCase
-Node was selected as the container, similar to howAttributes
can only be created with aClass
as a parent in the ecore editor.In the ecore editor this is done by checking wheter or not the
containerId
of the CreateNodeOperation is aClass
. So i have done the same for the CMMN-Editor:CMMNElement container = getOrThrow(modelState.getIndex().getSemantic(operation.getContainerId(), CMMNElement.class), 'No valid container with id ' + operation.getContainerId() + ' found');
However it seems like the
containerId
is always the id of the graph root element and not the element i am actually clicking on. In this case aCase
.I tried to increase the size of the
Case
, since i thought that it might be caused by this, however this did not fix it.Did i understand the
getContainerId()
method wrong or is this strange and the editor has problems picking up the right element?original thread by simongraband
Beta Was this translation helpful? Give feedback.
All reactions