[JavaScript] How to get all task of workflow instance
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2013 11:28 AM
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.
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.
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2013 09:55 PM
You can't use RESTful APIs
If you didn't specify an authoriy ,tasks for the current user will be returned.
http://localhost:8080/alfresco/service/api/workflow-instances/${workflowInstanceId}/task-instances
it returns all workflow task Instances associated with an speicified authority.If you didn't specify an authoriy ,tasks for the current user will be returned.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2013 03:54 AM
thanks kaynezhang but still waiting for my answer.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2013 07:16 AM
I'm afraid now you can't get all tasks by using javascript api that ,why do you want to get all task?
You can implement this function by using java api
You can implement this function by using java api
org.alfresco.service.cmr.workflow.WorkflowService.queryTasks();
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2017 07:56 AM
Hi Kayne, how can I call this REST API :
http://localhost:8080/alfresco/service/api/workflow-instances/
from my rule JavaScript file ?