jomarko commented on code in PR #2546:
URL:
https://github.com/apache/incubator-kie-tools/pull/2546#discussion_r1764882707
##########
packages/dmn-editor/src/diagram/connections/isValidConnection.ts:
##########
@@ -39,14 +39,18 @@ export function checkIsValidConnection(
export function _checkIsValidConnection(
sourceNode: { type?: string; data: DmnDiagramNodeData } | undefined,
targetNode: { type?: string; data: DmnDiagramNodeData } | undefined,
- edgeType: string | null | undefined
+ edgeType: string | null | undefined,
+ extraArg?: {
+ allowExternalTarget: boolean;
+ }
) {
if (!sourceNode?.type || !targetNode?.type || !edgeType) {
return false;
}
- // External nodes cannot be targeted
- if (targetNode.data.dmnObjectQName.prefix) {
+ // External nodes cannot be targeted by default
+ // However there are exceptions, for example adding a waypoint on the edge
+ if (!extraArg?.allowExternalTarget && targetNode.data.dmnObjectQName.prefix)
{
Review Comment:
@danielzhe thank you for a comment.
the logic that marks node as external or not according to the prefix
`targetNode.data.dmnObjectQName.prefix` was in codebase even before my PR. I
would suggest the following:
- if there is an existing, more robust way, how to decide if node is or is
not external, I can incorporate it as part of this PR
- if there is not, what I understand is the situation, we should probably
change this behavior as part of a separate ticker ticket you mention - "In the
future, will we have local nodes with a prefix" - I see this as a ticket that
should handle what you suggest
please let me know what do you think
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]