public interface TaskRuntime
| Modifier and Type | Method and Description |
|---|---|
Task |
claim(ClaimTaskPayload claimTaskPayload)
Claim a task with the currently authenticated user
- If there is no authenticated user throw an IllegalStateException
- If the currently authenticated user is not a candidate throw an IllegalStateException
- The current approach doesn't support impersonation, it will always take the currently authenticated user
- after the claim the task should be in assigned status
|
Task |
complete(CompleteTaskPayload completeTaskPayload)
Completes the selected task with the variables set in the payload
- This method checks that the task is visible by the authenticated user
- This method also check that the task is assigned to the currently authenticated user before complete
- This method return a shallow Task object with the basic information needed to validate that the task was completed
|
TaskRuntimeConfiguration |
configuration() |
Task |
create(CreateTaskPayload createTaskPayload)
Creates a task based on the following rules
- If an assignee is provided it creates and assign the task to the provided user
- If there is no assignee the task is not assigned, just created
- The owner of the task is the currently authenticated user (which is automatically added as a candidate)
- If a group or list of groups is provided those groups are added as candidates for claiming the task
|
Task |
delete(DeleteTaskPayload deleteTaskPayload)
Deletes a task
- The authenticated user should be able to see the task in order to delete it
- The authenticated user needs to be the assignee of the task in order to delete it
- this method returns a shallow Task with the necessary information to validate that the task was deleted
|
Task |
release(ReleaseTaskPayload releaseTaskPayload)
Release a previously claimed task
- The authenticated user needs to be the assignee in order to release it
|
void |
setVariables(SetTaskVariablesPayload setTaskVariablesPayload) |
Task |
task(String taskId)
Get task by id if the authenticated user:
- is the assignee or
- is in a group with is assigned to the task or
- has admin role
|
Page<Task> |
tasks(Pageable pageable)
Get all tasks where
- the authenticated user is the actual assignee
- the user belongs to a group that is a candidate for the task
|
Page<Task> |
tasks(Pageable pageable,
GetTasksPayload getTasksPayload)
Get all tasks where applying the filters in the Payload
- the authenticated user is the actual assignee
- the user belongs to a group that is a candidate for the task
|
Task |
update(UpdateTaskPayload updateTaskPayload)
Updates details of a task
- The authenticated user should be able to see the task in order to update its details
- The authenticated user needs to be the assignee of the task to update its details, if not he/she will need to claim the task first
|
List<VariableInstance> |
variables(GetTaskVariablesPayload getTaskVariablesPayload) |
TaskRuntimeConfiguration configuration()
Task task(String taskId)
Page<Task> tasks(Pageable pageable)
Page<Task> tasks(Pageable pageable, GetTasksPayload getTasksPayload)
Task create(CreateTaskPayload createTaskPayload)
Task claim(ClaimTaskPayload claimTaskPayload)
Task release(ReleaseTaskPayload releaseTaskPayload)
Task complete(CompleteTaskPayload completeTaskPayload)
Task update(UpdateTaskPayload updateTaskPayload)
Task delete(DeleteTaskPayload deleteTaskPayload)
List<VariableInstance> variables(GetTaskVariablesPayload getTaskVariablesPayload)
void setVariables(SetTaskVariablesPayload setTaskVariablesPayload)
Copyright © 2010–2018 Alfresco. All rights reserved.