| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod ConvertSnapshotToTransportType ( | 
|   DssKpiSnapshot snapshot | 
| ) as owning KpiSnapshotData | 
| { | 
|   Description: 'Converts a snapshot from storage to a KpiSnapshotData object.' | 
|   TextBody: | 
|   [* | 
|     data := construct( KpiSnapshotData ); | 
|      | 
|     // Read the snapshot 'identification'.  | 
|     data.ServerDateTime( snapshot.ServerDateTime() ); | 
|     data.PlanDateTime( snapshot.PlanDateTime() ); | 
|     data.SourceDatasetMDSID( snapshot.DatasetMDSID() ); | 
|     data.RetentionPolicyIdentification( guard( snapshot.RetentionPolicy().Identification(), KpiModelExtensions::GetDefaultRetentionPolicyIdentification() ) ); | 
|      | 
|     // Read the KPI Values. | 
|     values := snapshot.GetValues(); | 
|     kpis   := snapshot.Configuration().MetaDataInConfiguration( relget ); | 
|      | 
|     // Create a KpiValueData object for each element in the configuration/vector. | 
|     traverse( kpis, Elements, kpi ) | 
|     { | 
|       name  := kpi.KpiName() | 
|       value := values.Element( kpi.Index() ); | 
|       data.CreateValue( name, value ); | 
|     } | 
|      | 
|     // Read the Label values. | 
|     traverse( snapshot, LabelValueInSnapshot.LabelValue, label ) | 
|     { | 
|       data.CreateLabel( label.Label().Name(), label.Value() ); | 
|     } | 
|                                                                  | 
|     return &data; | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |