tiagobento commented on code in PR #2546:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2546#discussion_r1729527574


##########
packages/dmn-editor/src/mutations/addEdge.ts:
##########
@@ -195,20 +194,22 @@ export function addEdge({
 
 function doesInformationRequirementsPointTo(a: 
Normalized<DMN15__tInformationRequirement>, nodeId: string) {
   return (
-    a.requiredInput?.["@_href"] === `${nodeId}` || //
-    a.requiredDecision?.["@_href"] === `${nodeId}`
+    // use endsWith because @_href is sometimes prefixed with '#' and 
sometimes it is not

Review Comment:
   I know this is in draft, but let me tell you already that using "endsWith" 
is not the way to go here. `hrefs` are structured strings, composed by a 
`namespace` and an `id`. They have this format:
   
   - `#id`; or
   - `namespace#id`; where `namespace` is an URL.
   
   We have a special parsing method to treat those and separate `namespace` and 
`id`. See `parseXmlHref`.
   



-- 
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