07-07-2021 06:18 PM
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?
07-08-2021 02:57 AM
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!
07-08-2021 08:48 PM
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.
07-09-2021 03:55 AM
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.
07-09-2021 04:23 AM
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);
07-09-2021 05:21 AM
Thanks @sanjaybandhniya by the way do you know an updated tutorial for developing workflows? Maybe that can help too @mangar
Cheers!
Explore our Alfresco products with the links below. Use labels to filter content by product module.