/** * Asynchronously executes simple scripting expressions, consisting of one search command and one action. * * @param objectType Object type to search (e.g. c:UserType) * @param filter Filter to be applied (ObjectFilter) * @param actionName Action to be executed on objects found (e.g. "disable", "delete", "recompute", etc). * @param task Task in context of which the script should execute. The task should be "clean", i.e. * (1) transient, (2) without any handler. This method puts the task into background, * and assigns ScriptExecutionTaskHandler to it, to execute the script. */ @Deprecated public void evaluateExpressionInBackground(QName objectType, ObjectFilter filter, String actionName, Task task, OperationResult parentResult) throws SchemaException { Validate.notNull(objectType); Validate.notNull(actionName); Validate.notNull(task); SearchExpressionType search = new SearchExpressionType(); search.setType(objectType); if (filter != null) { search.setSearchFilter(prismContext.getQueryConverter().createSearchFilterType(filter)); } ActionExpressionType action = new ActionExpressionType(); action.setType(actionName); search.setScriptingExpression(objectFactory.createAction(action)); evaluateExpressionInBackground(search, task, parentResult); }
<O extends ObjectType> AccessCertificationCampaignType createAdHocCampaignObject( AccessCertificationDefinitionType definition, PrismObject<O> focus, Task task, OperationResult result) throws SecurityViolationException, SchemaException { definition.setName(PolyStringType.fromOrig(PolyString.getOrig(definition.getName()) + " " + PolyString.getOrig(focus.getName()))); definition.setLastCampaignIdUsed(null); AccessCertificationCampaignType campaign = createCampaignObject(definition, task, result); AccessCertificationObjectBasedScopeType scope; if ((campaign.getScopeDefinition() instanceof AccessCertificationObjectBasedScopeType)) { scope = (AccessCertificationObjectBasedScopeType) campaign.getScopeDefinition(); } else { // TODO! scope = new AccessCertificationAssignmentReviewScopeType(prismContext); campaign.setScopeDefinition(scope); } Class<? extends ObjectType> focusClass = focus.asObjectable().getClass(); scope.setObjectType(ObjectTypes.getObjectType(focusClass).getTypeQName()); ObjectFilter objectFilter = prismContext.queryFor(focusClass).id(focus.getOid()).buildFilter(); scope.setSearchFilter(getQueryConverter().createSearchFilterType(objectFilter)); return campaign; }
.item(FocusType.F_ASSIGNMENT, AssignmentType.F_TARGET_REF).ref(referenceValue) .buildFilter(); SearchFilterType filterType = prismContext.getQueryConverter().createSearchFilterType(refFilter); QueryType queryType = new QueryType(); queryType.setFilter(filterType);
.item(UserType.F_COST_CENTER).eq("100") .buildFilter(); SearchFilterType filterBean = prismContext.getQueryConverter().createSearchFilterType(filter);
.targetSelector(new ObjectSelectorType(prismContext) .type(RoleType.COMPLEX_TYPE) .filter(prismContext.getQueryConverter().createSearchFilterType(studentFilter))) .beginPolicyConstraints() .beginHasAssignment()