Insert(Index: Integer; Name: String; Desc: IMetabaseObjectDescriptor): IBProcessParam;
Index. Position index in the collection.
Name. Name of created parameter.
Desc. Description of the repository dictionary, on which the parameter will be based.
The Insert method in the specified position creates a new process parameter based on the specified name and repository dictionary.
The method returns settings of the created parameter.
Executing the example requires that the repository contains a process with the PROCESS identifier and a dictionary with the D_SCENARIO identifier.
Add links to the BPM, Metabase system assemblies. Add a link to the assembly that is required to work with processes.
Sub UserProc;
Var
Mb: IMetabase;
MObj: IMetabaseObjectDescriptor;
Process: IBProcess;
Params: IBProcessParams;
Param: IBProcessParam;
Begin
Mb := MetabaseClass.Active;
MObj := Mb.ItemById("PROCESS");
// Get process structure
Process := BProcessCollection.EditByKey(MObj.Key);
Params := Process.Params;
// Create parameter
Param := Params.Insert(0, "Execution scenario", Mb.ItemById("D_SCENARIO"));
Param.CheckElementsRights := True;
// Save changes
Process.Save;
End Sub UserProc;
After executing the example, a new parameter that is connected to the specified dictionary is created in the process. The parameter will be inserted to the first position in the collection.
See also: