AnsweredAssumed Answered

How to extract qnameType from JS?

Question asked by redomancer on Dec 16, 2009
Latest reply on Dec 16, 2009 by redomancer
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/model/workflow/1.0}adhocTask&container=plain

How to get this qnameType parameter correctly?

Outcomes