IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Developing using the JavaScript API > Samples
Returning a list of reference links
You can return a list of all reference links of the current process application or toolkit on a server by running the tw.system.model.processApp.getLinks() method.
Parameters
The method tw.system.model.processApp.getLinks() returns an array of TWLink and takes two parameters:
- includeReferencedToolkits
- This is a boolean flag that indicates if the links should be collected recursively on all library item elements contained in the process application and dependent toolkits.
- linkFilter
- This is a JavaScript function that takes TWLink as parameter and returns a boolean value that indicates whether the link should be excluded from the result.
You can collect the names and URLs of the links using the assetType Change Request from your process application and its children, and then assign them to local variables in your process.
var linkFilter = function (twlink) { if (twlink != null && TWLink.AssetTypes.CHANGE_REQUEST == twLink.assetTypeNamespace){ return false; }else{ return true; } } if(requestLinks != null){ for(var i=0; i<requestLinks.length; i++){ tw.local.requestLinksName[i] = requestLinks[i].name; tw.local.requestLinksURL[i] = requestLinks[i].url; } }Attention: If the call is done from the context of another process application, only the links of the process application can be obtained. The filtered list will not include any children.