cancel
Showing results for 
Search instead for 
Did you mean: 

How to get taskId by contentId?

zg0571
Champ in-the-making
Champ in-the-making
Hello,
I learn the wiki "Adding a Custom Dialog", and I want to custom a action that I could see the workflow history in the browse.jsp.
My action code is like the "ManageTaskDialog.java".But I find I can't get the taskId,I just get the id of content.
How I could get the taskId ?Whether has a nother way to do?
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
ManageTaskDialog.java is dealing with tasks whereas browse.jsp is displaying content. In order to show workflow history you'll need to get hold of the task that is associated with each content item, to do this you'll need to find the workflows that that content is currently involved in.

Have a look at renderAdvancedWorkflowInfo() in UINodeWorkflowInfo for an example of retrieving workflow info for an arbitary content item.

zg0571
Champ in-the-making
Champ in-the-making
Great.
Thanks gavinc.That's helpfull.

zg0571
Champ in-the-making
Champ in-the-making
Hi, gavic.
I have met another problem.When my workflow finished ,I find I could not get the tasks.How did I do?

gavinc
Champ in-the-making
Champ in-the-making
Once a task is completed the task gets marked as completed and the workflow is marked as non-active.

To retrieve the details of a workflow that has completed you need to use slightly different parameters i.e. to get a list of completed tasks you use:

List<WorkflowTask> tasks = this.workflowService.getAssignedTasks(
                  userName, WorkflowTaskState.COMPLETED);

Hope this helps.