@Override public List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, List<String> actorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath) { return createTask(coreSession, principal, document, taskName, null, null, actorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath); }
public void createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath) { createTask(coreSession, principal, document, TaskConstants.TASK_TYPE_NAME, taskName, null, null, prefixedActorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath); }
@Override public String getTaskRootParentPath(CoreSession coreSession) { GetTaskRootParentPathUnrestricted runner = new GetTaskRootParentPathUnrestricted(coreSession); runner.runUnrestricted(); return runner.getParentPath(); }
@Override public List<Task> getAllTaskInstances(String processId, CoreSession session) { return getTasks(TaskQueryConstant.GET_TASKS_FOR_PROCESS_PP, session, true, null, processId); }
@Override public String acceptTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment) { return endTask(coreSession, principal, task, comment, TaskEventNames.WORKFLOW_TASK_COMPLETED, true); }
/** * @deprecated since 6.0, use {@link #wrapDocModelInTask(List)} instead. */ @Deprecated public static List<Task> wrapDocModelInTask(DocumentModelList taskDocuments) { return wrapDocModelInTask(taskDocuments, false); }
/** * @since 5.8 * @deprecated since 7.4 use * {@link #createTaskForProcess(CoreSession, NuxeoPrincipal, List, String, String, String, String, String, List, boolean, String, String, Date, Map, String, Map)} * instead */ @Override @Deprecated public List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, List<DocumentModel> documents, String taskDocumentType, String taskName, String taskType, String processId, List<String> actorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath, Map<String, Serializable> eventInfo) { return createTaskForProcess(coreSession, principal, documents, taskDocumentType, taskName, taskType, processId, null, actorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath, eventInfo); }
@Override public List<Task> getAllTaskInstances(String processId, NuxeoPrincipal user, CoreSession session) { List<String> actors = TaskActorsHelper.getTaskActors(user); return getAllTaskInstances(processId, actors, session); }
@Override public List<Task> getCurrentTaskInstances(CoreSession coreSession) { // Get tasks for current user // We need to build the task actors list: prefixed and unprefixed names // of the principal and all its groups NuxeoPrincipal principal = coreSession.getPrincipal(); List<String> actors = TaskActorsHelper.getTaskActors(principal); return getCurrentTaskInstances(actors, coreSession); }
@Override public List<Task> getAllTaskInstances(String processId, String nodeId, CoreSession session) { return getTasks(TaskQueryConstant.GET_TASKS_FOR_PROCESS_AND_NODE_PP, session, true, null, processId, nodeId); }
/** * @since 5.8 */ public void createTask(CoreSession coreSession, NuxeoPrincipal principal, List<DocumentModel> documents, String taskDocumentType, String taskName, String taskType, String processId, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath) { createTask(coreSession, principal, documents, taskDocumentType, taskName, taskType, processId, null, prefixedActorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath); }
/** * @since 5.6 */ @Override public List<Task> createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, String taskType, String processId, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath) { return createTask(coreSession, principal, document, TaskConstants.TASK_TYPE_NAME, taskName, taskType, processId, prefixedActorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath, null); }
@Override public String rejectTask(CoreSession coreSession, NuxeoPrincipal principal, Task task, String comment) { return endTask(coreSession, principal, task, comment, TaskEventNames.WORKFLOW_TASK_REJECTED, false); }
@Override public List<Task> getAllTaskInstances(String processId, List<String> actors, CoreSession session) { return getTasks(TaskQueryConstant.GET_TASKS_FOR_PROCESS_AND_ACTORS_PP, session, true, null, processId, actors); }
@Override public void run() { if (StringUtils.isEmpty(taskDocumentType)) { taskDocumentType = TaskConstants.TASK_TYPE_NAME; } createTask(session, principal, documents, taskDocumentType, taskName, taskType, processId, processName, prefixedActorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath); }
/** * Provide @param sortInfo to handle sort page-provider contributions (see {@link #getCurrentTaskInstances}) * * @since 5.9.3 */ @Override public List<Task> getCurrentTaskInstances(List<String> actors, CoreSession coreSession, List<SortInfo> sortInfos) { if (actors == null || actors.isEmpty()) { return new ArrayList<>(); } return getTasks(TaskQueryConstant.GET_TASKS_FOR_ACTORS_PP, coreSession, true, sortInfos, actors); }
/** * @since 5.6 */ public void createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskDocumentType, String taskName, String taskType, String processId, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath) { List<DocumentModel> docs = new ArrayList<>(); docs.add(document); createTask(coreSession, principal, docs, taskDocumentType, taskName, taskType, processId, prefixedActorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath); }
@Override public List<Task> getTaskInstances(DocumentModel dm, List<String> actors, boolean includeDelegatedTasks, CoreSession session) { if (includeDelegatedTasks) { return getTasks(TaskQueryConstant.GET_TASKS_FOR_TARGET_DOCUMENTS_AND_ACTORS_OR_DELEGATED_ACTORS_PP, session, true, null, dm.getId(), dm.getId(), actors, actors); } else { return getTasks(TaskQueryConstant.GET_TASKS_FOR_TARGET_DOCUMENTS_AND_ACTORS_PP, session, true, null, dm.getId(), dm.getId(), actors); } }
@Override public List<Task> getAllCurrentTaskInstances(CoreSession session, List<SortInfo> sortInfos) { // Get tasks for current user // We need to build the task actors list: prefixed and unprefixed names // of the principal and all its groups NuxeoPrincipal principal = session.getPrincipal(); List<String> actors = TaskActorsHelper.getTaskActors(principal); return getTasks(TaskQueryConstant.GET_TASKS_FOR_ACTORS_OR_DELEGATED_ACTORS_PP, session, true, sortInfos, actors, actors); }
@Override public List<Task> getTaskInstances(DocumentModel dm, NuxeoPrincipal user, CoreSession coreSession) { if (user == null) { return getTasks(TaskQueryConstant.GET_TASKS_FOR_TARGET_DOCUMENTS_PP, coreSession, true, null, dm.getId(), dm.getId()); } else { List<String> actors = TaskActorsHelper.getTaskActors(user); return getTasks(TaskQueryConstant.GET_TASKS_FOR_TARGET_DOCUMENTS_AND_ACTORS_PP, coreSession, true, null, dm.getId(), dm.getId(), actors); } }