Search in sources :

Example 1 with AbstractWorkSegmentationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractWorkSegmentationType in project midpoint by Evolveum.

the class FilterWorkBucketContentHandler method createSpecificFilters.

@NotNull
@Override
public List<ObjectFilter> createSpecificFilters(@NotNull WorkBucketType bucket, AbstractWorkSegmentationType configuration, Class<? extends Containerable> type, ItemDefinitionProvider itemDefinitionProvider) throws SchemaException {
    FilterWorkBucketContentType content = (FilterWorkBucketContentType) bucket.getContent();
    List<ObjectFilter> rv = new ArrayList<>();
    for (SearchFilterType filter : content.getFilter()) {
        rv.add(prismContext.getQueryConverter().createObjectFilter(type, filter));
    }
    return rv;
}
Also used : SearchFilterType(com.evolveum.prism.xml.ns._public.query_3.SearchFilterType) ArrayList(java.util.ArrayList) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) FilterWorkBucketContentType(com.evolveum.midpoint.xml.ns._public.common.common_3.FilterWorkBucketContentType) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with AbstractWorkSegmentationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractWorkSegmentationType in project midpoint by Evolveum.

the class BucketingManager method narrowQueryForWorkBucket.

/**
 * Narrows a query by taking specified bucket into account.
 */
public ObjectQuery narrowQueryForWorkBucket(@NotNull Class<? extends Containerable> type, ObjectQuery query, @NotNull ActivityDistributionDefinition distributionDefinition, @Nullable ItemDefinitionProvider itemDefinitionProvider, @NotNull WorkBucketType workBucket) throws SchemaException {
    WorkBucketContentHandler contentHandler = handlerRegistry.getHandler(workBucket.getContent());
    AbstractWorkSegmentationType segmentationConfig = BucketingUtil.getWorkSegmentationConfiguration(distributionDefinition.getBuckets());
    List<ObjectFilter> conjunctionMembers = new ArrayList<>(contentHandler.createSpecificFilters(workBucket, segmentationConfig, type, itemDefinitionProvider));
    return ObjectQueryUtil.addConjunctions(query, beans.prismContext, conjunctionMembers);
}
Also used : WorkBucketContentHandler(com.evolveum.midpoint.repo.common.activity.run.buckets.segmentation.content.WorkBucketContentHandler) ArrayList(java.util.ArrayList) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) AbstractWorkSegmentationType(com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractWorkSegmentationType)

Aggregations

ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)2 ArrayList (java.util.ArrayList)2 WorkBucketContentHandler (com.evolveum.midpoint.repo.common.activity.run.buckets.segmentation.content.WorkBucketContentHandler)1 AbstractWorkSegmentationType (com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractWorkSegmentationType)1 FilterWorkBucketContentType (com.evolveum.midpoint.xml.ns._public.common.common_3.FilterWorkBucketContentType)1 SearchFilterType (com.evolveum.prism.xml.ns._public.query_3.SearchFilterType)1 NotNull (org.jetbrains.annotations.NotNull)1