Class TaskSpecification

All Implemented Interfaces:
Serializable, org.springframework.data.jpa.domain.Specification<TaskEntity>

public class TaskSpecification extends SpecificationSupport<TaskEntity,TaskSearchRequest>
See Also:
  • Method Details

    • unrestricted

      public static TaskSpecification unrestricted(TaskSearchRequest taskSearchRequest)
      Creates a specification that retrieve tasks that match filters in the request without restrictions related to any user.
      Parameters:
      taskSearchRequest - the request containing all the filters
      Returns:
      a specification that applies the filters in the request
    • restricted

      public static TaskSpecification restricted(TaskSearchRequest taskSearchRequest, String userId, Collection<String> userGroups)
      Creates a specification that applies the filters and restricts the retrieved tasks based on the given user and groups. In addition to the filters, tasks are retrieved if they match one of the following conditions: - user is assignee - user is owner - user is candidate and task is not assigned - any of the user groups is candidate group and task is not assigned - there are no candidate users and groups set and task is not assigned
      Parameters:
      taskSearchRequest - the request containing all the filters
      userId - user id to be applied for restriction
      userGroups - groups to be applied for restriction
      Returns:
      a specification that applies the filters and restricts the retrieved tasks based on the given user and groups
    • toPredicate

      public jakarta.persistence.criteria.Predicate toPredicate(jakarta.persistence.criteria.Root<TaskEntity> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
      Specified by:
      toPredicate in interface org.springframework.data.jpa.domain.Specification<TaskEntity>
      Overrides:
      toPredicate in class SpecificationSupport<TaskEntity,TaskSearchRequest>
    • getIdAttribute

      protected jakarta.persistence.metamodel.SingularAttribute<TaskEntity,String> getIdAttribute()
      Specified by:
      getIdAttribute in class SpecificationSupport<TaskEntity,TaskSearchRequest>
    • getProcessVariablesAttribute

      protected jakarta.persistence.metamodel.SetAttribute<TaskEntity,ProcessVariableEntity> getProcessVariablesAttribute()
      Specified by:
      getProcessVariablesAttribute in class SpecificationSupport<TaskEntity,TaskSearchRequest>