Search in sources :

Example 1 with LifecycleStateType

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;
}
Also used : LifecycleStateType(com.evolveum.midpoint.xml.ns._public.common.common_3.LifecycleStateType)

Example 2 with LifecycleStateType

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;
}
Also used : LifecycleStateType(com.evolveum.midpoint.xml.ns._public.common.common_3.LifecycleStateType) VirtualAssignmentSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualAssignmentSpecificationType) SearchFilterType(com.evolveum.prism.xml.ns._public.query_3.SearchFilterType) QName(javax.xml.namespace.QName) VirtualAssignmenetSpecification(com.evolveum.midpoint.schema.VirtualAssignmenetSpecification) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter)

Aggregations

LifecycleStateType (com.evolveum.midpoint.xml.ns._public.common.common_3.LifecycleStateType)2 ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)1 VirtualAssignmenetSpecification (com.evolveum.midpoint.schema.VirtualAssignmenetSpecification)1 VirtualAssignmentSpecificationType (com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualAssignmentSpecificationType)1 SearchFilterType (com.evolveum.prism.xml.ns._public.query_3.SearchFilterType)1 QName (javax.xml.namespace.QName)1