Class TaskSpecification
java.lang.Object
org.activiti.cloud.services.query.rest.specification.SpecificationSupport<org.activiti.cloud.services.query.model.TaskEntity,TaskSearchRequest>
org.activiti.cloud.services.query.rest.specification.TaskSpecification
- All Implemented Interfaces:
Serializable,org.springframework.data.jpa.domain.Specification<org.activiti.cloud.services.query.model.TaskEntity>
public class TaskSpecification
extends SpecificationSupport<org.activiti.cloud.services.query.model.TaskEntity,TaskSearchRequest>
- See Also:
-
Field Summary
Fields inherited from class org.activiti.cloud.services.query.rest.specification.SpecificationSupport
filterConditions, javaTypeMapping, predicates, searchRequestFields inherited from interface org.springframework.data.jpa.domain.Specification
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.persistence.metamodel.SingularAttribute<org.activiti.cloud.services.query.model.TaskEntity, String> protected jakarta.persistence.metamodel.SetAttribute<org.activiti.cloud.services.query.model.TaskEntity, org.activiti.cloud.services.query.model.ProcessVariableEntity> static TaskSpecificationrestricted(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.jakarta.persistence.criteria.PredicatetoPredicate(jakarta.persistence.criteria.Root<org.activiti.cloud.services.query.model.TaskEntity> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) static TaskSpecificationunrestricted(TaskSearchRequest taskSearchRequest) Creates a specification that retrieve tasks that match filters in the request without restrictions related to any user.Methods inherited from class org.activiti.cloud.services.query.rest.specification.SpecificationSupport
addLikeFilters, applyIdFilter, applyProcessVariableFilters, applySorting, joinProcessVariables, reset, validateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.jpa.domain.Specification
and, or
-
Method Details
-
unrestricted
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 filtersuserId- user id to be applied for restrictionuserGroups- 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<org.activiti.cloud.services.query.model.TaskEntity> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) - Specified by:
toPredicatein interfaceorg.springframework.data.jpa.domain.Specification<org.activiti.cloud.services.query.model.TaskEntity>- Overrides:
toPredicatein classSpecificationSupport<org.activiti.cloud.services.query.model.TaskEntity,TaskSearchRequest>
-
getIdAttribute
protected jakarta.persistence.metamodel.SingularAttribute<org.activiti.cloud.services.query.model.TaskEntity,String> getIdAttribute()- Specified by:
getIdAttributein classSpecificationSupport<org.activiti.cloud.services.query.model.TaskEntity,TaskSearchRequest>
-
getProcessVariablesAttribute
protected jakarta.persistence.metamodel.SetAttribute<org.activiti.cloud.services.query.model.TaskEntity,org.activiti.cloud.services.query.model.ProcessVariableEntity> getProcessVariablesAttribute()- Specified by:
getProcessVariablesAttributein classSpecificationSupport<org.activiti.cloud.services.query.model.TaskEntity,TaskSearchRequest>
-