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;
}
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);
}
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);
}
}
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;
}
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;
}
Aggregations