CreateSimpleCondition(
Dimension: IOrmSimpleClass;
Criteria: IDimTextCriteria): IDimOrmCondition;
Dimension. Dictionary implemented by the interface IOrmSimpleClass. Dictionary structure or MDM dictionary structure can be passed as parameter value.
Criteria. Element search criterion.
The CreateSimpleCondition method creates an object for working with conditions of element search in dictionaries and MDM dictionaries.
Executing the example requires an MDM repository with the MDM identifier. This repository contains an MDM dictionary with the Dict_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
RdsDict: IRdsDictionary;
RdsDictInst: IRdsDictionaryInstance;
OrmMan: IDimOrmManager;
Condition: IDimOrmCondition;
Crit: IDimTextCriteria;
Elems: IRdsDictionaryElements;
Elem: IRdsDictionaryElement;
i: Integer;
Begin
MB := MetabaseClass.Active;
RdsDict := MB.ItemByIdNamespace("Dict_1", MB.ItemById("RDS").Key).Bind As IRdsDictionary;
RdsDictInst := RdsDict.Open(Null);
OrmMan := New DimOrmManager.Create;
Crit := New DimTextCriteria.Create;
Crit.CriteriaOptions := TextCriteriaOptions.SearchStringAttributes Or TextCriteriaOptions.FreeText;
Crit.Text := "Data";
Condition := OrmMan.CreateSimpleCondition(RdsDict As IOrmSimpleClass, Crit);
Elems := RdsDictInst.Elements;
For i := 0 To Elems.Count - 1 Do
Elem := Elems.Item(i);
Debug.WriteLine(Elem.Name + ": Satisfies search conditions - " +
Condition.EvaluateRec(Elem.Record).ToString);
End For;
End Sub UserProc;
Executing the example creates an object for working with search conditions based on selected MDM dictionary and search criterion. Next, all elements are checked for meeting the search conditions. Element names and checking results are displayed in development environment console.
See also: