Interface SimulationResultManager
-
- All Known Implementing Classes:
SimulationResultManagerImpl
public interface SimulationResultManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SimulationResultManager.SimulatedFunctionCall<X>
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull SimulationResult
createSimulationResult(@Nullable SimulationDefinitionType definition, @Nullable Task rootTask, @Nullable ConfigurationSpecificationType configurationSpecification, @NotNull OperationResult result)
Creates a new simulation result in repository.@NotNull SimulationDefinitionType
defaultDefinition()
Returns the default simulation definition: either from the system configuration (if present there), or a new one.<X> X
executeWithSimulationResult(@NotNull TaskExecutionMode mode, @Nullable SimulationDefinitionType simulationDefinition, @NotNull Task task, @NotNull OperationResult result, @NotNull SimulationResultManager.SimulatedFunctionCall<X> functionCall)
@Nullable SimulationMetricDefinitionType
getMetricDefinition(@NotNull String identifier)
Returns the definition of a metric or `null` if there's none.SimulationResult
getSimulationResult(@NotNull String resultOid, @NotNull OperationResult result)
Provides aSimulationResult
for given simulation result OID.@NotNull List<? extends ProcessedObject<?>>
getStoredProcessedObjects(@NotNull String oid, OperationResult result)
Fetches and parses all stored processed objects from givenSimulationResultType
.
-
-
-
Method Detail
-
createSimulationResult
@NotNull @NotNull SimulationResult createSimulationResult(@Nullable @Nullable SimulationDefinitionType definition, @Nullable @Nullable Task rootTask, @Nullable @Nullable ConfigurationSpecificationType configurationSpecification, @NotNull @NotNull OperationResult result) throws ConfigurationException
Creates a new simulation result in repository.- Parameters:
definition
- Definition to use. If null, the default one is used.- Throws:
ConfigurationException
- See Also:
defaultDefinition()
-
getSimulationResult
SimulationResult getSimulationResult(@NotNull @NotNull String resultOid, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException
Provides aSimulationResult
for given simulation result OID. May involve repository get operation. Makes sure that the simulation result is open. Although this does not prevent writing to closed results (as the result may be closed after obtaining the context), it should be good enough to cover e.g. cases when we re-use existing result by mistake.
-
defaultDefinition
@NotNull @NotNull SimulationDefinitionType defaultDefinition() throws ConfigurationException
Returns the default simulation definition: either from the system configuration (if present there), or a new one. Returned value is freely modifiable by client.- Throws:
ConfigurationException
-
getStoredProcessedObjects
@VisibleForTesting @NotNull @NotNull List<? extends ProcessedObject<?>> getStoredProcessedObjects(@NotNull @NotNull String oid, OperationResult result) throws SchemaException
Fetches and parses all stored processed objects from givenSimulationResultType
.- Throws:
SchemaException
-
executeWithSimulationResult
<X> X executeWithSimulationResult(@NotNull @NotNull TaskExecutionMode mode, @Nullable @Nullable SimulationDefinitionType simulationDefinition, @NotNull @NotNull Task task, @NotNull @NotNull OperationResult result, @NotNull @NotNull SimulationResultManager.SimulatedFunctionCall<X> functionCall) throws CommonException
SeeModelInteractionService.executeWithSimulationResult(TaskExecutionMode, SimulationDefinitionType, Task, OperationResult, SimulatedFunctionCall)
. When in `functionCall`, theTask.getSimulationTransaction()
returns non-null value for the task.- Throws:
CommonException
-
getMetricDefinition
@Nullable @Nullable SimulationMetricDefinitionType getMetricDefinition(@NotNull @NotNull String identifier)
Returns the definition of a metric or `null` if there's none.
-
-