TaskActivityService

public interface TaskActivityService

Service for managing task activities. Task activities are used for storing information about past task executions.

Methods

addError

void addError(Task task, TaskHandlerException e)

Logs an execution error for the given task.

Parameters:
  • task – the failed task, not null
  • e – the cause of the error, not null

addSuccess

void addSuccess(Task task)

Logs an execution success for the given task.

Parameters:
  • task – the succeeded task, not null

addWarning

void addWarning(Task task)

Logs a warning for the given task.

Parameters:
  • task – the task, not null

addWarning

void addWarning(Task task, String key, String value)

Logs a warning for the given task.

Parameters:
  • task – the task, not null
  • key – the key of the message
  • value – the name of the field that caused the warning

addWarning

void addWarning(Task task, String key, String field, Exception e)

Logs a warning for the given task.

Parameters:
  • task – the task, not null
  • key – the key of the message
  • field – the name of the failed that caused the warning, not null
  • e – the exception that caused the warning, not null

deleteActivitiesForTask

void deleteActivitiesForTask(Long taskId)

Deletes all activities for the task with the given ID.

Parameters:
  • taskId – the task ID, not null

getLatestActivities

List<TaskActivity> getLatestActivities()

Returns 10 most recent activities as a list, ordered by date.

Returns:the list of all activities

getTaskActivities

List<TaskActivity> getTaskActivities(Long taskId, Set<TaskActivityType> activityTypeSet, QueryParams queryParams)

Returns list of all activities for task with the given ID.

Parameters:
  • taskId – the task ID, null returns null
  • activityTypeSet – the type of activities
  • queryParams – query parameters to use while retrieving
Returns:

the list of all activities for task with given ID

getTaskActivitiesCount

long getTaskActivitiesCount(Long taskId, Set<TaskActivityType> activityTypes)

Returns the count of all activities for the given task, of the specified type.

Parameters:
  • taskId – the task ID
  • activityTypes – the type of activities to include in count
Returns:

the count of matching activities

getTaskActivitiesCount

long getTaskActivitiesCount(Long taskId, TaskActivityType type)

Returns the count of all activities for the given task, of the specified type.

Parameters:
  • taskId – the task ID
  • type – the type of activity to include in count
Returns:

the count of matching activities