use of com.evolveum.midpoint.xml.ns._public.common.common_3.LifecycleStateType in project midpoint by Evolveum.
the class ActivationComputer method lifecycleHasActiveAssignments.
public boolean lifecycleHasActiveAssignments(String lifecycleStatus, LifecycleStateModelType stateModel) {
LifecycleStateType stateDefinition = LifecycleUtil.findStateDefinition(stateModel, lifecycleStatus);
if (stateDefinition == null) {
return defaultLifecycleHasActiveAssignments(lifecycleStatus, stateModel);
}
Boolean activeAssignments = stateDefinition.isActiveAssignments();
if (activeAssignments == null) {
return defaultLifecycleHasActiveAssignments(lifecycleStatus, stateModel);
}
return activeAssignments;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.LifecycleStateType in project midpoint by Evolveum.
the class LifecycleUtil method getForcedAssignmentSpecification.
public static <R extends AbstractRoleType> VirtualAssignmenetSpecification<R> getForcedAssignmentSpecification(LifecycleStateModelType lifecycleStateModel, String targetLifecycleState, PrismContext prismContext) throws SchemaException {
LifecycleStateType stateDefinition = findStateDefinition(lifecycleStateModel, targetLifecycleState);
if (stateDefinition == null) {
return null;
}
VirtualAssignmentSpecificationType virtualAssignmentSpecificationType = stateDefinition.getForcedAssignment();
if (virtualAssignmentSpecificationType == null) {
return null;
}
SearchFilterType filter = virtualAssignmentSpecificationType.getFilter();
if (filter == null) {
return null;
}
QName targetType = virtualAssignmentSpecificationType.getTargetType();
Class<R> targetClass = (Class<R>) AbstractRoleType.class;
if (targetType != null) {
targetClass = (Class<R>) prismContext.getSchemaRegistry().getCompileTimeClassForObjectType(targetType);
}
VirtualAssignmenetSpecification<R> virtualAssignmenetSpecification = new VirtualAssignmenetSpecification();
virtualAssignmenetSpecification.setType(targetClass);
ObjectFilter objectFilter = prismContext.getQueryConverter().parseFilter(filter, targetClass);
virtualAssignmenetSpecification.setFilter(objectFilter);
return virtualAssignmenetSpecification;
}
Aggregations