本文整理汇总了Java中org.activiti.engine.task.TaskQuery.listPage方法的典型用法代码示例。如果您正苦于以下问题:Java TaskQuery.listPage方法的具体用法?Java TaskQuery.listPage怎么用?Java TaskQuery.listPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.task.TaskQuery
的用法示例。
在下文中一共展示了TaskQuery.listPage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: queryRuntimeTasks
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
private List<WorkflowTask> queryRuntimeTasks(WorkflowTaskQuery query)
{
// Runtime-tasks only exist on process-instances that are active
// so no use in querying runtime tasks if not active
if (!Boolean.FALSE.equals(query.isActive()))
{
TaskQuery taskQuery = createRuntimeTaskQuery(query);
List<Task> results;
int limit = query.getLimit();
if (limit > 0)
{
results = taskQuery.listPage(0, limit);
}
else
{
results = taskQuery.list();
}
return getValidWorkflowTasks(results);
}
return new ArrayList<WorkflowTask>();
}
示例2: searchWorkItems
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
public SearchResultList<WorkItemType> searchWorkItems(ObjectQuery query, Collection<SelectorOptions<GetOperationOptions>> options, OperationResult result)
throws SchemaException {
TaskQuery taskQuery = createTaskQuery(query, true, options, result);
if (taskQuery == null) {
return new SearchResultList<>(Collections.emptyList());
}
Integer offset = query != null ? query.getOffset() : null;
Integer maxSize = query != null ? query.getMaxSize() : null;
List<Task> tasks;
if (offset == null && maxSize == null) {
tasks = taskQuery.list();
} else {
tasks = taskQuery.listPage(defaultIfNull(offset, 0), defaultIfNull(maxSize, Integer.MAX_VALUE));
}
boolean getAllVariables = true; // TODO implement based on options
// there's no need to fill-in assignee details ; but candidates are necessary to fill-in; TODO implement based on options (resolve)
return tasksToWorkItems(tasks, null, false, false, true, getAllVariables, result);
}
示例3: myAppTodoTasks
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
@RequestMapping(value = "/form/app/todo", method = RequestMethod.GET, produces = "application/json")
public Object myAppTodoTasks(HttpServletRequest request, String userId) {
PageParams pp = ui.getPageParams(request);
List<TodoTaskVo> todoTasks = new ArrayList<TodoTaskVo>();
TaskQuery taskQuery = this.taskService.createTaskQuery();
long taskCount = taskQuery.taskCandidateOrAssigned(userId).count();
if (taskCount > 0) {
List<Task> tasks = taskQuery.listPage(pp.getOffset(), pp.getLimit());
for (Task t : tasks) {
TodoTaskVo todo = new TodoTaskVo();
todo.setTaskId(t.getId());
todo.setTitle(t.getName());
todo.setDisplayTime(t.getCreateTime());
todoTasks.add(todo);
}
}
PageList<TodoTaskVo> pageList = new PageList<TodoTaskVo>(todoTasks, new Paginator(taskCount));
return ui.putData(pageList);
}
示例4: findTasks
import org.activiti.engine.task.TaskQuery; //导入方法依赖的package包/类
public List<JournalTask> findTasks(CfJournalType journalType, Integer offset, Integer limit) {
String prefix = CfJournal.class.getCanonicalName() + ":" + journalType.name() + ":" + "%";
log.debug("prefix: " + prefix);
TaskQuery taskQuery = taskService.createTaskQuery();
taskQuery.taskNameLike(prefix);
taskQuery.orderByTaskCreateTime();
taskQuery.desc();
List<Task> list = taskQuery.listPage(offset, limit);
return toDocumentTasks(list);
}