cancel
Showing results for 
Search instead for 
Did you mean: 

How to get noderef parameter in the workflow page

skumar_us
Champ in-the-making
Champ in-the-making
I am trying to get the noderef parameter in the workflow page by passing the workflowinstance.package which is present in the page.The AJAX call below return "401 unauthorized" error.i did try with changing the url to
"Alfresco.constants.PROXY_URI + "-noauth/slingshot/node/workspace/SpacesStore/"+workflowinstance.package",still no luck.is there any way I can get the noderef parameter in the task-list.js ?

url: Alfresco.constants.PROXY_URI + "/slingshot/node/workspace/SpacesStore/"+workflowinstance.package,which is giving me the below error
status" :
  {
    "code" : 401,
    "name" : "Unauthorized",
    "description" : "The request requires HTTP authentication."
  }, 

I found out that calling the above webscript need admin access.can i call this webscript from a consumer user ??
1 REPLY 1

skumar_us
Champ in-the-making
Champ in-the-making
found the solution .noderef can be get by passing the task id. below is the script code for this

function main(){
var taskId = args.taskId
var task = workflow.getTaskById(taskId);
var nodeRef = task.getPackageResources()[0].nodeRef;
model.nodeRef = nodeRef;
}
main();