cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract qnameType from JS?

redomancer
Champ in-the-making
Champ in-the-making
http://wiki.alfresco.com/wiki/Workflow_JavaScript_API is written that WorkflowTaskItem supports property qnameType.
This means that I must be able to get task name with namespace (for example, qnameType must return {http://www.alfresco.org/model/workflow/1.0}adhocTask). The problem is that this variable is empty!

Here is my JS script located in Data Dictionary folder and executed on custom action ("id" aka node ref and "taskid" are passed in):

var id = args["id"];
var taskId = args["taskId"];
var task = workflow.getTaskById(taskId);
var taskType = task.qnameType;
var result = "<script>location.href = 'http://myserver/mypage?documentid=" + id + "&taskid=" + taskId + "&type=" + taskType + "';</script>";
result;

Object "task" is not null as I can extract the name via getName() (method described here: http://wiki.alfresco.com/wiki/Workflow_JavaScript_API).

How to extract qnameType? I need to pass parameters to my page where back link will be created in form like:
http://localhost:8080/alfresco/command/ui/managetask?id=jbpm$8028161&type={http://www.alfresco.org/m...

How to get this qnameType parameter correctly?
1 REPLY 1

redomancer
Champ in-the-making
Champ in-the-making
Seems the problem is mutch bigger - task.properties or task.getProperties() also are null.
This post
http://forums.alfresco.com/en/viewtopic.php?f=34&t=23648
also indicates that.

Plz, any ideas how to get these parameters?