It's all about the answers!

Ask a question

Create artifact with RM API in RDNG


Dmitry A. Lesin (24826996) | asked Mar 25 '19, 2:14 p.m.
edited Mar 25 '19, 2:17 p.m.

 Hello!

I'm trying to create several artifacts as described by next link:


First artifact is created without a problem. But I have a strange message taken from result.message if a second artifact is to be created next in a loop:

At the same time, next message is displayed on Web page:

The artifact cannot be placed at the specified location in the module.hide details
ID CRRRW7756W  While you were working in the module, another user might have changed and saved it. Refresh the module and try again.

Is it possible to create several artifacts with RM API somehow? What is missing by me in this code?
Thank you!

One answer



permanent link
Dmitry A. Lesin (24826996) | answered Mar 26 '19, 2:29 p.m.
edited Mar 26 '19, 2:30 p.m.
 It seems that next RM.Data.Module.createArtifact must be put into callback of the previous one. I mean that the next construction is wrong:

RM.Data.Module.createArtifact(attrs, strategy, function(result2) {
if (result2.code === RM.OperationResult.OPERATION_OK) {
//...
}
});
RM.Data.Module.createArtifact(attrs, strategy, function(result3) {
if (result3.code === RM.OperationResult.OPERATION_OK) {
//...
}
});

But the next one works:

RM.Data.Module.createArtifact(attrs, strategy, function(result2) {
if (result2.code === RM.OperationResult.OPERATION_OK) {
//...
RM.Data.Module.createArtifact(attrs, strategy, function(result3) {
if (result3.code === RM.OperationResult.OPERATION_OK) {
//...
}
});
}
});

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.