cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve taskId from custom control share tier

evoci
Champ in-the-making
Champ in-the-making
I am trying to integrate a custom control within my custom workflow derived from bpm:workflowTask, in Alfresco 4.2.
My custom control invokes a webscript in the repo tier, and I need to pass the taskId for which the control instance is running to that webscript.
My goal is to retrieve task variables from the webscript by using
var taskId = args["taskId"];
var task = workflow.getTaskById(taskId);

I don't know how to retrieve the taskId in my control.inc.ftl; any hint appreciated.
3 REPLIES 3

tonyrivet
Champ in-the-making
Champ in-the-making
Hi,

You can get the task id using
${args.itemId}
in any control of the task-edit form.

evoci
Champ in-the-making
Champ in-the-making
I succeded in retrieving itemId, thanks.
That however appears to be the id of the workflow definition, not the id of the instance, therefore I cannot use it to retrieve the variables.
Did I miss something?

Elio

tonyrivet
Champ in-the-making
Champ in-the-making
On which form are you trying to get your task id ?

The itemId is the workflow definition id on the start task form, but it should be the task id in any other task edit form.