IMsMetaAttributeValues.OutputParameter

Fore Syntax

OutputParameter: IMsModelParam;

Fore.NET Syntax

OutputParameter: Prognoz.Platform.Interop.Ms.IMsModelParam;

Description

The OutputParameter property determines output parameter.

Comments

Output parameter is used to calculate validation rules.

Fore Example

Executing the example requires a form containing the WorkbookDocumentViewerBox component with the WorkbookDocumentViewerBox1 identifier and the UiErAnalayzer component with the UiErAnalyzer1 identifier. UiErAnalyzer1 is a data source for WorkbookDocumentViewerBox1 and contains a loaded workbook of the time series database with the TSDB identifier. Time series database parameters:

Add links to the Cubes, Dimensions, Metabase, Ms, Rds, Stat system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    FCObj: IMetabaseObject;
    FC: IRubricator;
    Atts: IMetaAttributes;
    LinkedDict: IMetabaseObjectDescriptor;
    ValidObj: IMetabaseObject;
    ValidFilter: IValidationFilter;
    ParamProvider: IMsParamProvider;
    Params: IMsModelParams;
    ComparPrarm: IMsModelParam;
    ExecSett: IValidationExecuteSettings;
    Analyzer: IEaxAnalyzer;
    ParamVals: IMsModelParamValues;
    DimSel: IDimSelection;
    ExecRun: IValidationExecRun;
    DiagRep: IDiagnosticReport;
    Filter: IMsMetaAttributeFilter;
    FilterVal: IMsMetaAttributeValues;
Begin
    mb := MetabaseClass.Active;
    // Get time series database
    FCObj := mb.ItemById("TSDB").Bind;
    FC := FCObj As IRubricator;
    //Get a dictionary to which the "CITY" attribute refers
    Atts := FC.GetDictionary(RubricatorDictionary.Facts).Attributes;
    LinkedDict := Atts.FindById("CITY").ValuesObject;
    //Get validation rule
    ValidObj := Mb.ItemByIdNamespace("VALIDATION_COMPARPARAM", FCObj.Key).Edit;
    ValidFilter := ValidObj As IValidationFilter;
    // Get validation rule parameters
    Analyzer := UiErAnalyzer1.ErAnalyzer;
    ValidFilter.ParamProvider := Analyzer.ParamProvider As IMsParamProvider;
    ParamProvider := ValidFilter.ParamProvider;
    Params := ParamProvider.Params;
    Params.Clear;
    // Add filtering parameter
    ComparPrarm := Params.Add;
    ComparPrarm.Id := "COMPAR_CITY";
    ComparPrarm.Name := "City for filtering block";
    ComparPrarm.LinkedObject := LinkedDict;
    ComparPrarm.ParamType := TsParamType.Selection;
    // Save validation rule
    ValidObj.Save;
    // Set rule execution parameters
    ExecSett := ValidFilter.CreateExecuteSettings;
    ExecSett.Laner := Analyzer.Laner;
    // Set filter
    Filter := ExecSett.Filter;
    Filter.Clear;
    FilterVal := Filter.Add(Atts.FindById("CITY"));
    FilterVal.OutputParameter := ComparPrarm;
    // Set parameter values
    ParamVals := ExecSett.ParamValues;
    DimSel := (LinkedDict.Open(NullAs IDimInstance).CreateSelection;
    DimSel.SelectElement(1False);
    ParamVals.FindById("COMPAR_CITY").Value := DimSel;
    // Execute validation rule
    ExecRun := ValidFilter.Execute(ExecSett);
    DiagRep := New DiagnosticReport.Create;
    DiagRep.Run := ExecRun;
    DiagRep.EaxAnalyzer := Analyzer;
End Sub UserProc;

Example execution parameter: filter is set for the VALIDATION_COMPARPARAM validation rule. Filtering is set by the COMPAR_CITY parameter determining value of the CITY mandatory attribute. The rule is executed for the workbook displayed in WorkbookDocumentViewerBox1.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ms;
Imports Prognoz.Platform.Interop.Rds;
Imports Prognoz.Platform.Interop.Transform;

Sub UserProc();
Var
    mb: IMetabase;
    FCObj: IMetabaseObject;
    FC: IRubricator;
    Atts: IMetaAttributes;
    LinkedDict: IMetabaseObjectDescriptor;
    ValidObj: IMetabaseObject;
    ValidFilter: IValidationFilter;
    ParamProvider: IMsParamProvider;
    Params: IMsModelParams;
    ComparPrarm: IMsModelParam;
    ExecSett: ValidationExecuteSettings;
    Analyzer: EaxAnalyzer;
    ParamVals: IMsModelParamValues;
    DimSel: IDimSelection;
    ExecRun: IValidationExecRun;
    DiagRep: IDiagnosticReport;
    Filter: IMsMetaAttributeFilter;
    FilterVal: IMsMetaAttributeValues;
Begin
    mb := Self.Metabase;
    // Get time series database
    FCObj := mb.ItemById["TSDB"].Bind();
    FC := FCObj As IRubricator;
    //Get a dictionary to which the "CITY" attribute refers
    Atts := FC.GetDictionary(RubricatorDictionary.rubdicFacts, RubricatorDictionaryOperation.rubdicopNone).Attributes;
    LinkedDict := Atts.FindById("CITY").ValuesObject;
    //Get validation rule
    ValidObj := Mb.ItemByIdNamespace["VALIDATION_COMPARPARAM", FCObj.Key].Edit();
    ValidFilter := ValidObj As IValidationFilter;
    // Get validation rule parameters
    Analyzer := uiErAnalyzerNet1.ErAnalyzer.ErAnalyzer;
    ValidFilter.ParamProvider := Analyzer.ParamProvider As IMsParamProvider;
    ParamProvider := ValidFilter.ParamProvider;
    Params := ParamProvider.Params;
    Params.Clear();
    // Add filtering parameter
    ComparPrarm := Params.Add();
    ComparPrarm.Id := "COMPAR_CITY";
    ComparPrarm.Name := "City for filtering block";
    ComparPrarm.LinkedObject := LinkedDict;
    ComparPrarm.ParamType := TsParamType.tsptSelection;
    // Save validation rule
    ValidObj.Save();
    // Set rule execution parameters
    ExecSett := ValidFilter.CreateExecuteSettings();
    ExecSett.Laner := Analyzer.Laner;
    // Set filter
    Filter := ExecSett.Filter;
    Filter.Clear();
    FilterVal := Filter.Add(Atts.FindById("CITY"));
    FilterVal.OutputParameter := ComparPrarm;
    // Set parameter values
    ParamVals := ExecSett.ParamValues;
    DimSel := (LinkedDict.Open(NullAs IDimInstance).CreateSelection();
    DimSel.SelectElement(1False);
    ParamVals.FindById("COMPAR_CITY").Value := DimSel;
    // Execute validation rule
    ExecRun := ValidFilter.Execute(ExecSett);
    DiagRep := New DiagnosticReport.Create();
    DiagRep.Run := ExecRun;
    DiagRep.EaxAnalyzer := Analyzer;
End Sub UserProc;

See also:

IMsMetaAttributeValues