Skip to content

Commit

Permalink
MID-8536 should be now properly handled via SimulationResultProcessed…
Browse files Browse the repository at this point in the history
…ObjectType -> ProcessedObject.getDelta()
  • Loading branch information
1azyman committed Mar 16, 2023
1 parent 7646b54 commit cce07bf
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.evolveum.midpoint.model.api.simulation.ProcessedObject;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.schema.DeltaConvertor;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.Trace;
Expand Down Expand Up @@ -378,6 +379,25 @@ protected String getPaginationCssClass() {
detailsModel);
add(details);

IModel<List<ObjectDeltaType>> deltas = new LoadableDetachableModel<>() {

@Override
protected List<ObjectDeltaType> load() {
ObjectDeltaType delta = objectModel.getObject().getDelta();
try {
ProcessedObject<?> object = SimulationsGuiUtil.parseProcessedObject(objectModel.getObject(), PageSimulationResultObject.this);

// this should provide better delta - with proper estimated old values, since simulation processed object
// contains before/after state of object together with delta
delta = DeltaConvertor.toObjectDeltaType(object.getDelta());
} catch (Exception ex) {
// intentionally empty
}

return List.of(delta);
}
};

ChangesPanel changesNew = new ChangesPanel(ID_CHANGES_NEW, () -> Arrays.asList(objectModel.getObject().getDelta()), null);
changesNew.setShowOperationalItems(true);
changesNew.add(new VisibleBehaviour(() -> !isExperimentalFeaturesDisabled()));
Expand Down

0 comments on commit cce07bf

Please sign in to comment.