How to implement edges creation? #959
Replies: 2 comments
-
Hey, Did you add a list of edgeTypeHints in your Diagram Configuration? This looks like this (Copied from the Workflow example): get edgeTypeHints(): EdgeTypeHint[] {
return [
createDefaultEdgeTypeHint(DefaultTypes.EDGE),
{
elementTypeId: types.WEIGHTED_EDGE,
repositionable: true,
deletable: true,
routable: true,
sourceElementTypeIds: [types.DECISION_NODE],
targetElementTypeIds: [types.MANUAL_TASK, types.AUTOMATED_TASK, types.FORK_NODE, types.JOIN_NODE]
}
];
} Type hints are used to indicate what can be created (or reparented/reconnected/...) where (Parent/Child relationship for nodes, source/target relationship for edges). The palette content is derived from these hints. |
Beta Was this translation helpful? Give feedback.
-
If the palette entry for your edge type is missing, you also need to add the palette entry. This can either be done
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm using the
node-json-vscode
template to start with my project. This template already implements resizing, a type of node and node position. However, it doesn't implement linking the nodes (creating edges between the nodes).Upon reading the documentation and watching some presentations about the
GSLP
I saw that I need to implement aOperationHandler
forCreateEdgeOperation
- which I did. There I edit the source model (thetasks
default one) and added a property oflinkedTo
, which holds thetargetElementId
from the operation (all of that inside theexecute
method of the handler).Following that, I updated the
GModelFactory
to create the edges when the task have the field I just added.But when I start both the client and server it doesn't seem to work. On the palette I get the
Edges
menu (was there already), but there's nothing to click there. What am I missing?I think I need to create the trigger on the client side, but I have no idea how to do this. I checked the code from the
workflow
template but wasn't able to figure it out too.Beta Was this translation helpful? Give feedback.
All reactions