Insert(Index: Integer; Step_: IBProcessStep);
Index. Index of the position, to which a step is added.
Step_. The step that should be added to the collection.
The Insert method inserts step to the specified position of the collection.
Executing the example requires that the repository contains a process with the PROCESS identifier. At least one stage is created in the process.
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;
MDesc: IMetabaseObjectDescriptor;
Process: IBProcess;
Steps: IBProcessSteps;
Step_: IBProcessStep;
Begin
Mb := MetabaseClass.Active;
MDesc := Mb.ItemById("PROCESS");
// Get process structure
Process := BProcessCollection.EditByKey(MDesc.Key);
// Get collection of steps of the first stage
Steps := Process.Stages.Item(0).StepGroups.Item(0).Steps;
// Create a new step
Step_ := Steps.CreateNewStep(BProcessStepType.ManualTask, "New stage", Process);
Step_.Description := "Notify everyone about new work stage";
// Add a step to the collection
Steps.Insert(0, Step_);
// Save changes
Process.Save;
End Sub UserProc;
After executing the example a new step is created for process stage. This step is placed to the first position of the stage steps group.
See also: