ParamAttribute(Param: IRdsParam): IRdsAttribute;
ParamAttribute[Prognoz.Platform.Interop.Rds.IRdsParam]: Prognoz.Platform.Interop.Rds.IRdsAttribute;
Param. Parameter of a linked dictionary, for which it is necessary to determine binding.
The ParamAttribute property determines binding of a parameter of a linked dictionary with an attribute of a current dictionary, control is executed through its values.
Executing the example requires an MDM repository with the NSI_1 identifier that contains MDM dictionaries with the Dict_1 and Dict_2 identifiers. The second dictionary has one parameter. Add links to the Metabase, Dal and Rds system assemblies.
Sub Macro;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict, Dict2: IRdsDictionary;
Attrs: IRdsAttributes;
LinkAttr, ParamAttr: IRdsAttribute;
Link: IRdsLink;
Param: IRdsParam;
ParamsControl: IRdsParamsControl;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("Dict_1", MB.ItemById("NSI_1").Key).Edit;
Dict := MObj As IRdsDictionary;
Dict2 := MB.ItemByIdNamespace("Dict_2", MB.ItemById("NSI_1").Key).Bind As IRdsDictionary;
//Attributes of the first dictionary
Attrs := Dict.Attributes;
//Attribute for linking with the dictionary
LinkAttr := Attrs.Add;
LinkAttr.DataType := DbDataType.Integer;
LinkAttr.Id := "LinkAttr";
LinkAttr.Name := Link attribute;
//Link with the parameterized dictionary
Link := Dict.Links.Add;
Link.Attribute := LinkAttr;
Link.Reference := Dict2.Attributes.Key;
Link.Id := "Link";
Link.Name := Link with the dictionary Dict_2;
//Parameter that needs to be controlled
Param := Link.Reference.Dictionary.Params.Item(0);
//Attribute for linking with the dictionary
ParamAttr := Attrs.Add;
ParamAttr.DataType := Param.Attribute.DataType;
ParamAttr.Id := "ParamAttr";
ParamAttr.Name := Parameter control;
//Linking attribute to the parameter of the second dictionary
ParamsControl := Link.ParamsControl;
ParamsControl.ParamAttribute(Dict2.Params.Item(0)) := ParamAttr;
MObj.Save;
End Sub Macro;
After executing the example two attributes are created in the first dictionary: the first one is used to link with the Dict_2 dictionary; the second one, to control parameter values of the Dict_2 dictionary. The link between the Dict_1 and Dict_2 dictionaries is established by the Key attribute; the ParamAttr attribute is used to control parameter values of the linked Dict_2 dictionary.
Executing the example requires an MDM repository with the NSI_1 identifier that contains MDM dictionaries with the Dict_1 and Dict_2 identifiers. The second dictionary has one parameter. Add links to the Dal and Rds system assemblies.
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Rds;
...
Public Shared Sub Macro(Params: StartParams);
Var
MB: IMetabase;
MObj: IMetabaseObject;
Dict, Dict2: IRdsDictionary;
Attrs: IRdsAttributes;
LinkAttr, ParamAttr: IRdsAttribute;
Link: IRdsLink;
Param: IRdsParam;
ParamsControl: IRdsParamsControl;
Begin
MB := Params.Metabase;
MObj := MB.ItemByIdNamespace["Dict_1", MB.ItemById["NSI_1"].Key].Edit();
Dict := MObj As IRdsDictionary;
Dict2 := MB.ItemByIdNamespace["Dict_2", MB.ItemById["NSI_1"].Key].Bind() As IRdsDictionary;
//Attributes of the first dictionary
Attrs := Dict.Attributes;
//Attribute for linking with the dictionary
LinkAttr := Attrs.Add();
LinkAttr.DataType := DbDataType.ddtInteger;
LinkAttr.Id := "LinkAttr";
LinkAttr.Name := Link attribute;
//Link with the parameterized dictionary
Link := Dict.Links.Add();
Link.Attribute := LinkAttr;
Link.Reference := Dict2.Attributes.Key;
Link.Id := "Link";
Link.Name := Link with the dictionary Dict_2;
//Parameter that needs to be controlled
Param := Link.Reference.Dictionary.Params.Item[0];
//Attribute for linking with the dictionary
ParamAttr := Attrs.Add();
ParamAttr.DataType := Param.Attribute.DataType;
ParamAttr.Id := "ParamAttr";
ParamAttr.Name := Parameter control;
//Linking attribute to the parameter of the second dictionary
ParamsControl := Link.ParamsControl;
ParamsControl.ParamAttribute[Dict2.Params.Item[0]] := ParamAttr;
MObj.Save();
End Sub;
After executing the example two attributes are created in the first dictionary: the first one is used to link with the Dict_2 dictionary; the second one, to control parameter values of the Dict_2 dictionary. The link between the Dict_1 and Dict_2 dictionaries is established by the Key attribute; the ParamAttr attribute is used to control parameter values of the linked Dict_2 dictionary.
See also: