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: [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]

Reply via email to