This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new 46a928a1f95 kie-issues#1963: DMN Editor: Edges are not being
auto-generated in special case of using namespace in href (#3133)
46a928a1f95 is described below
commit 46a928a1f95decb9a1abd751acd32558144092eb
Author: Aswathi <[email protected]>
AuthorDate: Fri May 23 08:02:02 2025 +0530
kie-issues#1963: DMN Editor: Edges are not being auto-generated in special
case of using namespace in href (#3133)
Co-authored-by: Aswathi T V <[email protected]>
Co-authored-by: Aswathi T V <[email protected]>
---
packages/dmn-editor/src/normalization/autoGenerateDrd.ts | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/packages/dmn-editor/src/normalization/autoGenerateDrd.ts
b/packages/dmn-editor/src/normalization/autoGenerateDrd.ts
index 0ed052a1ce8..8a87220a136 100644
--- a/packages/dmn-editor/src/normalization/autoGenerateDrd.ts
+++ b/packages/dmn-editor/src/normalization/autoGenerateDrd.ts
@@ -26,7 +26,7 @@ import { getNodeTypeFromDmnObject } from
"../diagram/maths/DmnMaths";
import { DMN15__tDefinitions } from
"@kie-tools/dmn-marshaller/dist/schemas/dmn-1_5/ts-gen/types";
import { DmnLatestModel } from "@kie-tools/dmn-marshaller";
import { Normalized } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
-import { parseXmlHref } from "@kie-tools/dmn-marshaller/dist/xml/xmlHrefs";
+import { buildXmlHref, parseXmlHref } from
"@kie-tools/dmn-marshaller/dist/xml/xmlHrefs";
import { computeIndexedDrd } from "../store/computed/computeIndexes";
import { getDefaultDrdName } from "../mutations/addOrGetDrd";
import { addShape } from "../mutations/addShape";
@@ -173,8 +173,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"] ?
buildXmlHref({ id: source }) : drgEdge.sourceId
+ );
+
+ const targetNode = updatedNodesByIdWithExternalNodes.get(
+ targetIdNamespace === args.model.definitions["@_namespace"] ?
buildXmlHref({ id: target }) : drgEdge.targetId
+ );
// Avoid missing nodes. Possible cause is an external model which couldn't
be found.
if (!edge || !sourceNode || !targetNode) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]