Search in sources :

Example 1 with ActivityState

use of com.evolveum.midpoint.repo.common.activity.run.state.ActivityState in project midpoint by Evolveum.

the class DistributedReportExportActivitySupport method fetchGlobalReportDataRef.

@NotNull
private ObjectReferenceType fetchGlobalReportDataRef(OperationResult result) throws SchemaException, ObjectNotFoundException, ActivityRunException {
    ActivityState activityState = ActivityState.getActivityStateUpwards(activity.getPath().allExceptLast(), runningTask, ReportExportWorkStateType.COMPLEX_TYPE, beans, result);
    ObjectReferenceType globalReportDataRef = activityState.getWorkStateReferenceRealValue(F_REPORT_DATA_REF);
    if (globalReportDataRef == null) {
        throw new ActivityRunException("No global report data reference in " + activityState, FATAL_ERROR, PERMANENT_ERROR);
    }
    return globalReportDataRef;
}
Also used : ActivityState(com.evolveum.midpoint.repo.common.activity.run.state.ActivityState) ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) ActivityRunException(com.evolveum.midpoint.repo.common.activity.run.ActivityRunException) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ActivityState

use of com.evolveum.midpoint.repo.common.activity.run.state.ActivityState in project midpoint by Evolveum.

the class CompositeMockActivityHandler method runBeforeExecution.

private void runBeforeExecution(EmbeddedActivity<CompositeMockWorkDefinition, CompositeMockActivityHandler> activity, RunningTask runningTask, OperationResult result) throws CommonException {
    ActivityState parentActivityState = ActivityState.getActivityStateUpwards(activity.getPath().allExceptLast(), runningTask, AbstractActivityWorkStateType.COMPLEX_TYPE, commonTaskBeans, result);
    getMockHelper().setLastMessage(parentActivityState, createUpdatedMessage(getMockHelper().getLastMessage(parentActivityState), activity.getIdentifier()), result);
}
Also used : ActivityState(com.evolveum.midpoint.repo.common.activity.run.state.ActivityState)

Example 3 with ActivityState

use of com.evolveum.midpoint.repo.common.activity.run.state.ActivityState in project midpoint by Evolveum.

the class ReconciliationActivityHandler method beforeResourceObjectsReconciliation.

private void beforeResourceObjectsReconciliation(EmbeddedActivity<ReconciliationWorkDefinition, ReconciliationActivityHandler> activity, RunningTask runningTask, OperationResult result) throws CommonException {
    ActivityState reconState = ActivityState.getActivityStateUpwards(activity.getPath().allExceptLast(), runningTask, ReconciliationWorkStateType.COMPLEX_TYPE, commonTaskBeans, result);
    if (reconState.getWorkStatePropertyRealValue(F_RESOURCE_OBJECTS_RECONCILIATION_START_TIMESTAMP, XMLGregorianCalendar.class) == null) {
        XMLGregorianCalendar now = XmlTypeConverter.createXMLGregorianCalendar();
        reconState.setWorkStateItemRealValues(F_RESOURCE_OBJECTS_RECONCILIATION_START_TIMESTAMP, now);
        reconState.flushPendingTaskModifications(result);
        LOGGER.debug("Set recon start timestamp to {}", now);
    }
}
Also used : ActivityState(com.evolveum.midpoint.repo.common.activity.run.state.ActivityState) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar)

Example 4 with ActivityState

use of com.evolveum.midpoint.repo.common.activity.run.state.ActivityState in project midpoint by Evolveum.

the class RemainingShadowsActivityRun method getReconciliationStartTimestamp.

@NotNull
private XMLGregorianCalendar getReconciliationStartTimestamp(OperationResult opResult) throws SchemaException, ObjectNotFoundException {
    ActivityState reconState = getActivityState().getParentActivityState(ReconciliationWorkStateType.COMPLEX_TYPE, opResult);
    XMLGregorianCalendar started = reconState.getWorkStatePropertyRealValue(F_RESOURCE_OBJECTS_RECONCILIATION_START_TIMESTAMP, XMLGregorianCalendar.class);
    stateCheck(started != null, "No reconciliation start timestamp in %s", reconState);
    return started;
}
Also used : ActivityState(com.evolveum.midpoint.repo.common.activity.run.state.ActivityState) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with ActivityState

use of com.evolveum.midpoint.repo.common.activity.run.state.ActivityState in project midpoint by Evolveum.

the class TestThresholdsStoryRecon method getExecutionStates.

@Override
protected Collection<ActivityState> getExecutionStates(OperationResult result) throws SchemaException, ObjectNotFoundException {
    Task task = taskManager.getTaskPlain(getTaskOid(), result);
    // Brutal hack...
    List<ActivityState> states = new ArrayList<>();
    states.addAll(getStateIfExists(ActivityPath.empty(), result, task));
    states.addAll(getStateIfExists(ModelPublicConstants.RECONCILIATION_OPERATION_COMPLETION_PATH, result, task));
    states.addAll(getStateIfExists(ModelPublicConstants.RECONCILIATION_RESOURCE_OBJECTS_PATH, result, task));
    states.addAll(getStateIfExists(ModelPublicConstants.RECONCILIATION_REMAINING_SHADOWS_PATH, result, task));
    return states;
}
Also used : ActivityState(com.evolveum.midpoint.repo.common.activity.run.state.ActivityState) Task(com.evolveum.midpoint.task.api.Task) ArrayList(java.util.ArrayList)

Aggregations

ActivityState (com.evolveum.midpoint.repo.common.activity.run.state.ActivityState)6 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 NotNull (org.jetbrains.annotations.NotNull)2 ActivityRunException (com.evolveum.midpoint.repo.common.activity.run.ActivityRunException)1 Task (com.evolveum.midpoint.task.api.Task)1 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)1 ArrayList (java.util.ArrayList)1