It's all about the answers!

Ask a question

RM.Data.createLink results in OPERATION_BAD_REQUEST (DNG JS API)


Thomas Noack (60215) | asked Mar 28 '15, 12:52 p.m.
edited Mar 28 '15, 12:54 p.m.
Hello everybody,

i'm trying to link two DNG resources via TypeScript (i.e. DNG JavaScript Api). The following operation results in OPERATION_BAD_REQUEST :

RM
.Data.createLink(this.artifact, RM.Data.LinkTypes.EMBEDS, pickedModule, function(result) {
      console.log("Link-Status: " + result.code + " - " + result.message);
});

this.artifact    : Single resource retrieved by RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED ...)
pickedModule : Module resource retrieved by RM.Client.showArtifactPicker(...)

Both resources exist in within the callback function. Does anyone has an idea, what might be the problem?

Best regards
-- Thomas Noack

One answer



permanent link
Donald Nong (14.5k614) | answered Apr 03 '15, 5:07 a.m.
The function works as expected, at least with RNDG 5.0.1. Without further details, it's hard to say what problem you were facing. I would guess either of the two artifacts in the function call is invalid (undefined or something).

To determine, examine the /rm/links POST request payload using a network tracing tool such as Firebug or the Chrome built-in tool. You should see the "subject", "object" and "predicate" well defined. Or you can set a break point at the code where the "createLink" function is and check whether "this.artifact" and "pickedModule" are valid (of the type RM.ArtifactRef) at run time.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.