@Test public void test300UserAssignmentPreview() throws Exception { final String TEST_NAME = "test300UserAssignmentPreview"; Task task = createTask(TEST_NAME); PrismObject<UserType> jack = getUser(USER_JACK_OID); display("jack", jack); AssignmentType ass1 = new AssignmentType(prismContext); ass1.setConstruction(new ConstructionType(prismContext)); ass1.getConstruction().setResourceRef(createObjectRef(RESOURCE_DUMMY_OID, RESOURCE)); ObjectDelta<UserType> delta = (ObjectDelta<UserType>) DeltaBuilder.deltaFor(UserType.class, prismContext) .item(UserType.F_ASSIGNMENT).add(ass1) .asObjectDelta(USER_JACK_OID); delta.applyDefinitionIfPresent(jack.getDefinition(), false); displayWhen(TEST_NAME); ModelContext<UserType> modelContext = modelInteractionService.previewChanges(Collections.<ObjectDelta<? extends ObjectType>>singletonList(delta), null, task, task.getResult()); List<ObjectDelta<? extends ObjectType>> primaryDeltas = new ArrayList<>(); List<ObjectDelta<? extends ObjectType>> secondaryDeltas = new ArrayList<>(); fillDeltas(modelContext, primaryDeltas, secondaryDeltas); List<? extends Scene> primaryScenes = modelInteractionService.visualizeDeltas(primaryDeltas, task, task.getResult()); List<? extends Scene> secondaryScenes = modelInteractionService.visualizeDeltas(secondaryDeltas, task, task.getResult()); displayThen(TEST_NAME); display("primary scenes", primaryScenes); display("secondary scenes", secondaryScenes); }
public List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult) throws SchemaException, ExpressionEvaluationException { OperationResult result = parentResult.createSubresult(CLASS_DOT + "visualizeDeltas"); try { resolver.resolve(deltas, task, result); return visualizeDeltas(deltas, new VisualizationContext(), task, result); } catch (RuntimeException | Error | SchemaException | ExpressionEvaluationException e) { result.recordFatalError("Couldn't visualize the data structure: " + e.getMessage(), e); throw e; } finally { result.computeStatusIfUnknown(); } }
Visualizer { public List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult) throws SchemaException, ExpressionEvaluationException { OperationResult result = parentResult.createSubresult(CLASS_DOT + "visualizeDeltas"); try { resolver.resolve(deltas, task, result); return visualizeDeltas(deltas, new VisualizationContext(), task, result); } catch (RuntimeException | Error | SchemaException | ExpressionEvaluationException e) { result.recordFatalError("Couldn't visualize the data structure: " + e.getMessage(), e); throw e; } finally { result.computeStatusIfUnknown(); } } }
Visualizer { public List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult) throws SchemaException, ExpressionEvaluationException { OperationResult result = parentResult.createSubresult(CLASS_DOT + "visualizeDeltas"); try { resolver.resolve(deltas, task, result); return visualizeDeltas(deltas, new VisualizationContext(), task, result); } catch (RuntimeException | Error | SchemaException | ExpressionEvaluationException e) { result.recordFatalError("Couldn't visualize the data structure: " + e.getMessage(), e); throw e; } finally { result.computeStatusIfUnknown(); } }  }
Visualizer { public List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult) throws SchemaException, ExpressionEvaluationException { OperationResult result = parentResult.createSubresult(CLASS_DOT + "visualizeDeltas"); try { resolver.resolve(deltas, task, result); return visualizeDeltas(deltas, new VisualizationContext(), task, result); } catch (RuntimeException | Error | SchemaException | ExpressionEvaluationException e) { result.recordFatalError("Couldn't visualize the data structure: " + e.getMessage(), e); throw e; } finally { result.computeStatusIfUnknown(); } }  SceneImpl visualize(PrismObject<? extends ObjectType> object, Task task, OperationResult parentResult); SceneImpl visualize(PrismObject<? extends ObjectType> object, VisualizationContext context, Task task, OperationResult parentResult); List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult); @NotNull SceneImpl visualizeDelta(ObjectDelta<? extends ObjectType> objectDelta, Task task, OperationResult parentResult); }
Visualizer { public List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult) throws SchemaException, ExpressionEvaluationException { OperationResult result = parentResult.createSubresult(CLASS_DOT + "visualizeDeltas"); try { resolver.resolve(deltas, task, result); return visualizeDeltas(deltas, new VisualizationContext(), task, result); } catch (RuntimeException | Error | SchemaException | ExpressionEvaluationException e) { result.recordFatalError("Couldn't visualize the data structure: " + e.getMessage(), e); throw e; } finally { result.computeStatusIfUnknown(); } }  SceneImpl visualize(PrismObject<? extends ObjectType> object, Task task, OperationResult parentResult); SceneImpl visualize(PrismObject<? extends ObjectType> object, VisualizationContext context, Task task, OperationResult parentResult); List<? extends SceneImpl> visualizeDeltas(List<ObjectDelta<? extends ObjectType>> deltas, Task task, OperationResult parentResult); @NotNull SceneImpl visualizeDelta(ObjectDelta<? extends ObjectType> objectDelta, Task task, OperationResult parentResult); static final String CLASS_DOT; }