Package com.collibra.dgc.core.api.component.workflow

# Interface WorkflowTaskApi

public interface WorkflowTaskApi
All the API for handling workflow tasks

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cancelWorkflowTask(UUID workflowTaskId, String reason)`
  Cancels the workflow task identified by the given UUID with provided reason.
  `Job`
  `cancelWorkflowTasksInJob(CancelWorkflowTasksRequest cancelWorkflowTasksRequest)`
  Cancels workflow tasks in a job.
  `List<WorkflowTask>`
  `completeWorkflowTasks(CompleteWorkflowTasksRequest completeWorkflowTasksRequest)`
  Completes tasks based on the provided request and returns the following tasks, if the current user is assigned to them.
  `PagedResponse<WorkflowTask>`
  `findWorkflowTasks(FindWorkflowTasksRequest findWorkflowTasksRequest)`
  Returns the workflow tasks matching given search criteria.
  `StartFormData`
  `getConfigurationStartFormData(UUID workflowDefinitionId, String formPropertyType)`
  Returns the configuration start form data of the workflow task.
  `Optional<FindActivitiesRequest>`
  `getFindActivitiesRequestForTask(UUID taskId)`
  Returns the activity filter for the workflow task identified by the given UUID.
  `StartFormData`
  `getStartFormData(UUID workflowDefinitionId, String formPropertyType)`
  Returns the start form data of the workflow task.
  `String`
  `getStartFormJsonModel(UUID workflowDefinitionId)`
  Returns the start form json model for the workflow definition.
  `TaskFormData`
  `getTaskFormData(UUID workflowTaskId, String formPropertyType)`
  Returns the task form data of the workflow task.
  `String`
  `getTaskFormJsonModel(UUID taskId)`
  Returns the task form json model for the workflow task id.
  `Map<String,Object>`
  `getVariables(UUID taskId)`
  Returns the variables for the workflow task id.
  `WorkflowTask`
  `getWorkflowTask(UUID workflowTaskId)`
  Returns the workflow task identified by given UUID.
  `void`
  `reassignTask(UUID taskId, List<UUID> users, List<UUID> groups, List<UUID> roles, List<UUID> roleCommunities)`
  Reassigns a task to the given users, groups and roles.

- ## Method Details

  - ### completeWorkflowTasks

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.CollectionFormatter.class) List<WorkflowTask> completeWorkflowTasks(CompleteWorkflowTasksRequest completeWorkflowTasksRequest)
    Completes tasks based on the provided request and returns the following tasks, if the current user is assigned to them.
    Parameters:
      `completeWorkflowTasksRequest` - the request describing the parameters for the workflow tasks to complete
    Returns:
      the following workflow tasks, if the current user is assigned to them
    Throws:
      `ApiEntityNotFoundException` - if workflow task does not exist

  - ### getWorkflowTask

    WorkflowTask getWorkflowTask(UUID workflowTaskId)
    Returns the workflow task identified by given UUID.
    Parameters:
      `workflowTaskId` - the UUID of the workflow task to return
    Returns:
      the workflow task
    Throws:
      `ApiEntityNotFoundException` - if workflow task does not exist

  - ### findWorkflowTasks

    @SecurityAuditMethod(resultFormatter=com.collibra.dgc.core.api.internal.security.audit.formatter.PagedResponseFormatter.class) PagedResponse<WorkflowTask> findWorkflowTasks(FindWorkflowTasksRequest findWorkflowTasksRequest)
    Returns the workflow tasks matching given search criteria.
    Parameters:
      `findWorkflowTasksRequest` - the search criteria for workflow tasks
    Returns:
      the found workflow tasks

  - ### getConfigurationStartFormData

    StartFormData getConfigurationStartFormData(UUID workflowDefinitionId, String formPropertyType)
    Returns the configuration start form data of the workflow task.
    Parameters:
      `workflowDefinitionId` - the UUID of the workflow definition that should be used for the form data retrieval
      `formPropertyType` - the form type to be returned
    Returns:
      the configuration start form data of the workflow task
    Throws:
      `ApiEntityNotFoundException` - if workflow definition does not exist

  - ### getStartFormData

    StartFormData getStartFormData(UUID workflowDefinitionId, String formPropertyType)
    Returns the start form data of the workflow task.
    Parameters:
      `workflowDefinitionId` - the UUID of the workflow definition that should be used for the form data retrieval
      `formPropertyType` - the form type to be returned
    Returns:
      the start form data of the workflow task
    Throws:
      `ApiEntityNotFoundException` - if workflow definition does not exist

  - ### getTaskFormData

    TaskFormData getTaskFormData(UUID workflowTaskId, String formPropertyType)
    Returns the task form data of the workflow task.
    Parameters:
      `workflowTaskId` - the UUID of the workflow task that should be used for the form data retrieval
      `formPropertyType` - the form type to be returned
    Returns:
      the task form data of the workflow task
    Throws:
      `ApiEntityNotFoundException` - if workflow task does not exist

  - ### getFindActivitiesRequestForTask

    Optional<FindActivitiesRequest> getFindActivitiesRequestForTask(UUID taskId)
    Returns the activity filter for the workflow task identified by the given UUID.
    Parameters:
      `taskId` - the UUID of the workflow task that the `FindActivitiesRequest` should be returned for
    Returns:
      the activity filter for the workflow task

  - ### cancelWorkflowTask

    void cancelWorkflowTask(UUID workflowTaskId, String reason)
    Cancels the workflow task identified by the given UUID with provided reason.
    Parameters:
      `workflowTaskId` - the UUID of the workflow task to be cancelled
      `reason` - the reason for the cancellation of the workflow instance
    Throws:
      `ApiEntityNotFoundException` - if workflow task does not exist

  - ### cancelWorkflowTasksInJob

    Job cancelWorkflowTasksInJob(CancelWorkflowTasksRequest cancelWorkflowTasksRequest)
    Cancels workflow tasks in a job.
    Parameters:
      `cancelWorkflowTasksRequest` - the properties of the workflow tasks to be cancelled
    Returns:
      the job that triggers asynchronous cancellation of workflow tasks

  - ### reassignTask

    void reassignTask(UUID taskId, List<UUID> users, List<UUID> groups, List<UUID> roles, List<UUID> roleCommunities)
    Reassigns a task to the given users, groups and roles.
    Parameters:
      `taskId` - The task id
      `users` - A list of user id's to reassign to
      `groups` - A list of group ids to reassign to
      `roles` - A list of role ids to reassign to
      `roleCommunities` - A list of Community ids of the specified roles to reassign to
    Throws:
      `ApiEntityNotFoundException` - if workflow task does not exist

  - ### getStartFormJsonModel

    String getStartFormJsonModel(UUID workflowDefinitionId)
    Returns the start form json model for the workflow definition.
    Parameters:
      `workflowDefinitionId` - the UUID of the workflow definition that should be used for the start form model retrieval
    Returns:
      the start form json model
    Throws:
      `ApiEntityNotFoundException` - if workflow definition does not exist

  - ### getTaskFormJsonModel

    String getTaskFormJsonModel(UUID taskId)
    Returns the task form json model for the workflow task id.
    Parameters:
      `taskId` - the UUID of the workflow task
    Returns:
      the task form json model
    Throws:
      `ApiEntityNotFoundException` - if workflow definition does not exist

  - ### getVariables

    @SecurityAuditMethod(resultFormatter=com.collibra.audit.formatter.MapCountFormatter.class) Map<String,Object> getVariables(UUID taskId)
    Returns the variables for the workflow task id. WARNING: This method will not return deprecated V1 objects, they will be skipped.
    Parameters:
      `taskId` - the UUID of the workflow task
    Returns:
      the variables
    Throws:
      `ApiEntityNotFoundException` - if workflow definition does not exist