use of com.evolveum.midpoint.repo.common.activity.run.state.ActivityState in project midpoint by Evolveum.
the class DistributedReportExportActivityHandler method createEmptyAggregatedDataObject.
private void createEmptyAggregatedDataObject(EmbeddedActivity<DistributedReportExportWorkDefinition, DistributedReportExportActivityHandler> activity, RunningTask runningTask, OperationResult result) throws CommonException {
ActivityState activityState = ActivityState.getActivityStateUpwards(activity.getPath().allExceptLast(), runningTask, ReportExportWorkStateType.COMPLEX_TYPE, commonTaskBeans, result);
if (activityState.getWorkStateReferenceRealValue(F_REPORT_DATA_REF) != null) {
return;
}
ReportType report = objectResolver.resolve(activity.getWorkDefinition().getReportRef(), ReportType.class, null, "resolve report ref", runningTask, result);
ReportDataType reportData = new ReportDataType(commonTaskBeans.prismContext).name(SaveReportFileSupport.getNameOfExportedReportData(report, getType(report)));
String oid = commonTaskBeans.repositoryService.addObject(reportData.asPrismObject(), null, result);
activityState.setWorkStateItemRealValues(F_REPORT_DATA_REF, createObjectRef(oid, ObjectTypes.REPORT_DATA));
activityState.flushPendingTaskModifications(result);
LOGGER.info("Created empty report data object {}", reportData);
}
Aggregations