Search in sources :

Example 1 with ProgressPanel

use of com.evolveum.midpoint.gui.impl.page.admin.component.ProgressPanel in project midpoint by Evolveum.

the class ProgressAwareChangesExecutorImpl method executeChanges.

/**
 * Executes changes on behalf of the parent page. By default, changes are executed asynchronously (in
 * a separate thread). However, when set in the midpoint configuration, changes are executed synchronously.
 *
 * @param deltas  Deltas to be executed.
 * @param options Model execution options.
 * @param task    Task in context of which the changes have to be executed.
 * @param result  Operation result.
 */
public Collection<ObjectDeltaOperation<? extends ObjectType>> executeChanges(Collection<ObjectDelta<? extends ObjectType>> deltas, boolean previewOnly, ModelExecuteOptions options, Task task, OperationResult result, AjaxRequestTarget target) {
    ProgressPanel progressPanel = progressAwarePage.startAndGetProgressPanel(target, result);
    ProgressReporter reporter = progressPanel.getReporterModel().getProcessData();
    if (reporter.isAsynchronousExecution()) {
        reporter.setAsyncOperationResult(null);
        progressPanel.setTask(task);
        executeChangesAsync(progressPanel, deltas, previewOnly, options, task, result);
    } else {
        executeChangesSync(reporter, deltas, previewOnly, options, task, result);
    }
    if (!reporter.isAsynchronousExecution()) {
        progressAwarePage.finishProcessing(target, reporter.isAsynchronousExecution(), result);
    }
    return reporter.getObjectDeltaOperation();
}
Also used : ProgressPanel(com.evolveum.midpoint.gui.impl.page.admin.component.ProgressPanel) ProgressReporter(com.evolveum.midpoint.web.component.progress.ProgressReporter)

Aggregations

ProgressPanel (com.evolveum.midpoint.gui.impl.page.admin.component.ProgressPanel)1 ProgressReporter (com.evolveum.midpoint.web.component.progress.ProgressReporter)1