Package com.comalatech.workflow
Interface TaskService
-
public interface TaskService
Provide services for manipulating the content's tasks. Note that for retrieving tasks you have to use the StateService- Since:
- 1.0
- See Also:
StateService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Task
assignTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String assignee, java.lang.String comment)
Assigns the given taskTask
assignTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String assignee, java.lang.String comment, java.util.Date dueDate)
Assigns the given taskTask
completeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String comment)
Completes the given task.Task
completeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String outcome, java.lang.String comment)
Deprecated.since 6.17.3 usecompleteTask(ContentEntityObject, String, String)
insteadTask
createTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskName, java.lang.String assignee, java.lang.String comment)
Create a task on the content in the current State.Task
createTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskName, java.lang.String assignee, java.lang.String comment, java.util.Date dueDate)
Create a task on the content in the current State.Task
editTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String newTaskName, java.lang.String newComment, java.util.Date dueDate)
Edits a currently existing task.java.util.List<ContentTask>
getActiveTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
Returns a list of tasks which are currently active on the given content object.java.util.List<ContentTask>
getCompletedTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
Returns a list of tasks which are completed on the given content object.java.util.List<ContentTask>
getTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
Returns all tasks which are on the given content object.void
removeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId)
Removes a given taskvoid
removeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String comment)
Removes a given task
-
-
-
Method Detail
-
createTask
Task createTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskName, java.lang.String assignee, java.lang.String comment, java.util.Date dueDate) throws WorkflowException
Create a task on the content in the current State. The task may be assigned to a user- Parameters:
content
- the content objecttaskName
- the name of the taskassignee
- the name of the assignee (optional)comment
- a comment of description of the taskdueDate
- the due date for this task. (alpha functionality, not yet supported)- Returns:
- the Task created
- Throws:
WorkflowException
- Since:
- 1.3
-
createTask
Task createTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskName, java.lang.String assignee, java.lang.String comment) throws WorkflowException
Create a task on the content in the current State. The task may be assigned to a user.- Parameters:
content
- the content objecttaskName
- the name of the taskassignee
- the name of the assignee (optional)comment
- a comment of description of the task- Returns:
- the Task created
- Throws:
WorkflowException
- Since:
- 1.0
-
editTask
Task editTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String newTaskName, java.lang.String newComment, java.util.Date dueDate) throws WorkflowException
Edits a currently existing task. This method works as a PUT operation where if no data is provided for a field and it had already a value then it will be removed.- Parameters:
content
- the content objecttaskId
- the id of the task to editnewTaskName
- the new name of the tasknewComment
- the new comment for the taskdueDate
- the new due date for the task (alpha functionality, not yet supported)- Returns:
- the updated Task object
- Throws:
WorkflowException
- Since:
- 1.3
-
completeTask
@Deprecated Task completeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String outcome, java.lang.String comment) throws WorkflowException
Deprecated.since 6.17.3 usecompleteTask(ContentEntityObject, String, String)
insteadCompletes the given task.- Parameters:
content
- the content objecttaskId
- the id of the task to completeoutcome
- the outcome of the task. User approved or rejected for Approval-type taskscomment
- a comment associated with the completion- Returns:
- the task containing the new completion
- Throws:
WorkflowException
- Since:
- 1.0
-
completeTask
Task completeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String comment) throws WorkflowException
Completes the given task.- Parameters:
content
- the content objecttaskId
- the id of the task to completecomment
- a comment associated with the completion- Returns:
- the task containing the new completion
- Throws:
WorkflowException
- Since:
- 6.17.3
-
removeTask
void removeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId) throws WorkflowException
Removes a given task- Parameters:
content
- the content objecttaskId
- the id of the task to remove- Throws:
WorkflowException
- Since:
- 1.1
-
removeTask
void removeTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String comment) throws WorkflowException
Removes a given task- Parameters:
content
- the content objecttaskId
- the id of the task to removecomment
- the comment associated with the deletion- Throws:
WorkflowException
- Since:
- 1.11.1
-
assignTask
Task assignTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String assignee, java.lang.String comment) throws WorkflowException
Assigns the given task- Parameters:
content
- the content objecttaskId
- the id of the task (in the current state)assignee
- the name of the assigneecomment
- the comment associated to this assignment- Returns:
- the task containing the new assignment
- Throws:
WorkflowException
- Since:
- 1.0
-
assignTask
Task assignTask(com.atlassian.confluence.core.ContentEntityObject content, java.lang.String taskId, java.lang.String assignee, java.lang.String comment, java.util.Date dueDate) throws WorkflowException
Assigns the given task- Parameters:
content
- the content objecttaskId
- the id of the task (in the current state)assignee
- the name of the assigneecomment
- the comment associated to this assignmentdueDate
- the due date for this task- Returns:
- the task containing the new assignment
- Throws:
WorkflowException
- Since:
- 1.3
-
getTasks
java.util.List<ContentTask> getTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
Returns all tasks which are on the given content object.- Parameters:
ceo
- the Content object to return the tasks for.- Returns:
- list of tasks, empty list if none.
-
getActiveTasks
java.util.List<ContentTask> getActiveTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
Returns a list of tasks which are currently active on the given content object.- Parameters:
ceo
- the content object to return the active tasks for.- Returns:
- list of active tasks, empty list if none.
-
getCompletedTasks
java.util.List<ContentTask> getCompletedTasks(com.atlassian.confluence.core.ContentEntityObject ceo)
Returns a list of tasks which are completed on the given content object.- Parameters:
ceo
- the content object to returne the completed tasks for.- Returns:
- list of compelted tasks, empty if none.
-
-