Search in sources :

Example 6 with WorkBucketType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType 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 7 with WorkBucketType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.WorkBucketType 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

ArrayList (java.util.ArrayList)6 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)4 DebugUtil (com.evolveum.midpoint.util.DebugUtil)4 List (java.util.List)4 ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)3 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)3 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)3 com.evolveum.midpoint.xml.ns._public.common.common_3 (com.evolveum.midpoint.xml.ns._public.common.common_3)3 File (java.io.File)3 Collection (java.util.Collection)3 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)3 NotNull (org.jetbrains.annotations.NotNull)3 Autowired (org.springframework.beans.factory.annotation.Autowired)3 DirtiesContext (org.springframework.test.annotation.DirtiesContext)3 ContextConfiguration (org.springframework.test.context.ContextConfiguration)3 Test (org.testng.annotations.Test)3 com.evolveum.midpoint.prism (com.evolveum.midpoint.prism)2 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)2 PropertyDelta (com.evolveum.midpoint.prism.delta.PropertyDelta)2 CloneUtil (com.evolveum.midpoint.prism.util.CloneUtil)2