As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
for each ( wf in document.activeWorkflows ) { var process_id = wf.id; var in_progress_task_id = wf.paths[0].tasks[0].id); }
workflow.getTaskById(id);
As alfresco javascript has limited apis available , standard approach to solve this problem is to use the workflowService, using webscript or actions which ever is suitable in scenario.
Below is sample code to get workflow definition id from noderef.
workflowService.getWorkflowsForContent(new NodeRef(""),true).get(0).getDefinition().getId()