You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tiagobento (via GitHub)" <gi...@apache.org> on 2025/05/21 20:56:47 UTC
Re: [PR] kie-issues#1963: Edges are not being auto-generated in special case of using namespace in href [incubator-kie-tools]
tiagobento commented on code in PR #3133:
URL: https://github.com/apache/incubator-kie-tools/pull/3133#discussion_r2101150772
##########
packages/dmn-editor/src/normalization/autoGenerateDrd.ts:
##########
@@ -173,8 +175,16 @@ export async function autoGenerateDrd(args: {
for (const drgEdge of updatedDrgEdgesWithExternalNodes) {
const edge = updatedEdgesByIdWithExternalNodes.get(drgEdge.id);
- const sourceNode = updatedNodesByIdWithExternalNodes.get(drgEdge.sourceId);
- const targetNode = updatedNodesByIdWithExternalNodes.get(drgEdge.targetId);
+ const { namespace: sourceIdNamespace, id: source } = parseXmlHref(drgEdge.sourceId);
+ const { namespace: targetIdNamespace, id: target } = parseXmlHref(drgEdge.targetId);
+
+ const sourceNode = updatedNodesByIdWithExternalNodes.get(
+ sourceIdNamespace === args.model.definitions["@_namespace"] ? `#${source}` : drgEdge.sourceId
+ );
+
+ const targetNode = updatedNodesByIdWithExternalNodes.get(
+ targetIdNamespace === args.model.definitions["@_namespace"] ? `#${target}` : drgEdge.targetId
+ );
Review Comment:
Please consider using `buildXmlHref` instead of manually prepending `#`. There are other parts of the codebase dealing with this kind of problem, you should be able to use a similar strategy to understand the "locality" relationship of a HREF depending on `thisDmn`.
##########
packages/dmn-editor/src/normalization/autoGenerateDrd.ts:
##########
@@ -33,6 +33,8 @@ import { addShape } from "../mutations/addShape";
import { addEdge } from "../mutations/addEdge";
import { EdgeType, NodeType } from "../diagram/connections/graphStructure";
import { PositionalNodeHandleId } from "../diagram/connections/PositionalNodeHandles";
+import { DmnDiagramNodeData } from "../diagram/nodes/Nodes";
+import * as RF from "reactflow";
Review Comment:
Leftover?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org