AnsweredAssumed Answered

[JavaScript] How to get all task of workflow instance

Question asked by poldet on Oct 14, 2013
Latest reply on Aug 24, 2017 by egor
I would like to get all the task instance from workflow instance (Include COMPLETED task) for JavaScript APIs
I've spend a long while searching for getting task. But everything i've got is to get paths from instance and then get task from path. but getPaths() just only contain in progress path not include completed path.
Like this
<javascript>
var workflowInstance = workflow.getInstance(wfInstanceId);
for each (var path in workflowInstance.getPaths()) {
   for each (var task in path.getTasks()) {
     // Collect in progress task.
   }
}
</javascript>
All my hope should be here. My last option is to use RESTful APIs http://localhost:8080/alfresco/service/api/workflow-instances/${workflowInstanceId}/task-instances but if it possible don't let me go that way it's very non sense.

Thanks for all reply.

Outcomes