/** * @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 7.4 */ @Override public List<Task> createTaskForProcess(CoreSession coreSession, NuxeoPrincipal principal, List<DocumentModel> documents, String taskDocumentType, String taskName, String taskType, String processId, String processName, List<String> actorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String, String> taskVariables, String parentPath, Map<String, Serializable> eventInfo) { if (StringUtils.isBlank(parentPath)) { parentPath = getTaskRootParentPath(coreSession); } CreateTaskUnrestricted runner = new CreateTaskUnrestricted(coreSession, principal, documents, taskDocumentType, taskName, taskType, processId, processName, actorIds, createOneTaskPerActor, directive, comment, dueDate, taskVariables, parentPath); runner.runUnrestricted(); List<Task> tasks = runner.getTasks(); for (Task task : tasks) { // notify notifyEvent(coreSession, task, documents, TaskEventNames.WORKFLOW_TASK_ASSIGNED, eventInfo, comment, principal, task.getActors()); } return tasks; } }
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 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); }
/** * @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); }
if (createOneTaskPerActor) { for (String prefixedActorId : prefixedActorIds) { createTask(coreSession, principal, documents, taskDocumentType, taskName, taskType, processId, Collections.singletonList(prefixedActorId), false, directive, comment, dueDate, taskVariables, parentPath);