In Java, how do I get a list of all the WorkflowTask object for a Workflow

cancel
Showing results for 
Search instead for 
Did you mean: 
mangar
Established Member II

In Java, how do I get a list of all the WorkflowTask object for a Workflow

I am trying to create a web page that describes the state of a particular workflow.  First I have to get that information.  So in Java through the WorkflowService,  I can get a list of workflows that are in progress.  perfect.

But from there it gets hard.  There is nothing like getTaskInstanceForWorkflow(workflowInstanceId)  that returns a List of TaskInstance.  I want a way to traverse a wokflow and pull info from it.

Can someone point me in the right direction?  Is there a tutorial out there that focuses on a pure Java aproach to handleing workflows?

5 Replies
cristinamr
Advanced

Re: In Java, how do I get a list of all the WorkflowTask object for a Workflow

Hi!

Maybe this tutorial can help you to clarify what is possible to achieve and how. But, you need to take in account the API of your Alfresco version.

Cheers!

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
mangar
Established Member II

Re: In Java, how do I get a list of all the WorkflowTask object for a Workflow

I have been through that tutorial several times,  and it seems to be geared more twords the workflow console and not the Java.  I am looking for more of a java based approach.  like, without haveing to go through source code (which I may endup doing) java examples for each of those dashboard commands.

cristinamr
Advanced

Re: In Java, how do I get a list of all the WorkflowTask object for a Workflow

Hi!

On that tutorial you have examples about how can you build your first workflow using java, after you have it, you'll need to play by yourself using the Java api according to your Alfresco's version.

In adition you have this in the official documentation.

Cheers,

Cristina.

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
sanjaybandhniya
Intermediate

Re: In Java, how do I get a list of all the WorkflowTask object for a Workflow

You can try WorkflowTaskQuery to get tasks of instance.

 

Ex.

WorkflowTaskQuery taskQuery = new WorkflowTaskQuery();
taskQuery.setActive(null);
taskQuery.setProcessId(workflowInstanceId);
taskQuery.setTaskState(state);
taskQuery.setOrderBy(new OrderBy[] { OrderBy.TaskDue_Asc });
List<WorkflowTask> allTasks; = workflowService.queryTasks(taskQuery);
Thanks & Regards,
Sanjay
cristinamr
Advanced

Re: In Java, how do I get a list of all the WorkflowTask object for a Workflow

Thanks @sanjaybandhniya  by the way do you know an updated tutorial for developing workflows? Maybe that can help too @mangar 

Cheers!

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc