09-10-2007 07:53 AM
public List<Node> getAllTasks() {
// get the current username
// FacesContext context = FacesContext.getCurrentInstance();
// User user = Application.getCurrentUser(context);
// String userName = user.getUserName();
//
// UserTransaction tx = null;
// try {
// tx = Repository.getUserTransaction(context, true);
// tx.begin();
this.allTasks = new ArrayList<Node>();
List<WorkflowInstance> workflows = new ArrayList<WorkflowInstance>();
workflows = workflowService.getWorkflowsForContent(
documentDetailsBean.getDocument().getNodeRef(), false);
workflows.addAll(workflowService.getWorkflowsForContent(
documentDetailsBean.getDocument().getNodeRef(), true));
if (workflows != null && workflows.size() > 0) {
for (WorkflowInstance wi : workflows) {
WorkflowTaskQuery query = new WorkflowTaskQuery();
//query.setTaskState(WorkflowTaskState.COMPLETED);
query.setProcessId(wi.id);
List<WorkflowTask> tasks = this.workflowService.queryTasks(query);
// create a list of transient nodes to represents
for (WorkflowTask task : tasks)
{
Node node = createTask(task);
this.allTasks.add(node);
if (logger.isDebugEnabled())
logger.debug("Added task: " + node);
}
}
}
// commit the changes
// tx.commit();
// } catch (Throwable e) {
// // rollback the transaction
// try {
// if (tx != null) {
// tx.rollback();
// }
// } catch (Exception ex) {
// }
// Utils.addErrorMessage("Failed to get all tasks: "
// + e.toString(), e);
// }
return this.allTasks;
}
09-10-2007 08:50 AM
query.setTaskState(null);
09-11-2007 01:40 AM
WorkflowTaskQuery query = new WorkflowTaskQuery();
query.setTaskState(null);
query.setProcessId(wi.id);
List<WorkflowTask> tasks = this.workflowService.queryTasks(query);
09-11-2007 06:17 AM
query.setActive(wi.active);
09-14-2007 10:22 AM
06-26-2018 01:20 AM
Thank you, Marc!
Regards.
09-14-2007 11:20 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.