Read the primary text of an artifact, RM.Data.getAttributes
One answer
Hello
Have you tried looking at the sample, ModuleExplorer?
It might display primary text, I am not sure.
Comments
Im trying to use a widget to get this can you help me with the following:
RM.Event.subscribe(RM.Event.ARTIFACT_SELECTED, function(module) {
console.log("--- Test for RM.Data.getContentsStructure ---");
RM.Data.getContentsAttributes(module[0], [RM.Data.Attributes.PRIMARY_TEXT], function(result){
if(result.code == RM.OperationResult.OPERATION_OK) {
result.data.forEach(function(item){
console.log(item.values[RM.Data.Attributes.NAME]);
});
}
else {
console.log("RM.OperationResult.OPERATION_KO");
return;
}
});
});
console.log("--- Test for RM.Data.getContentsStructure ---");
RM.Data.getContentsAttributes(module[0], [RM.Data.Attributes.PRIMARY_TEXT], function(result){
if(result.code == RM.OperationResult.OPERATION_OK) {
result.data.forEach(function(item){
console.log(item.values[RM.Data.Attributes.NAME]);
});
}
else {
console.log("RM.OperationResult.OPERATION_KO");
return;
}
});
});
error is:
item.values is undefined
Sorry, I can't help with that part. Someone from development would have to comment. You could get IBM Services to help with this but that would be at a cost.