Insert(Index: Integer; StepGroup: IBProcessStepGroup);
Index. Index of the position, to which group of steps is added.
StepGroup. The group of steps that should be added to the collection.
The Insert method inserts group of steps to the specified position of the collection.
Executing the example requires that the repository contains a process with the PROCESS identifier. A stage is created in the process, for which a gateway is enabled.
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;
Stage: IBProcessStage;
StepGroup: IBProcessStepGroup;
Step_: IBProcessStep;
Begin
Mb := MetabaseClass.Active;
MDesc := Mb.ItemById("PROCESS");
// Get process structure
Process := BProcessCollection.EditByKey(MDesc.Key);
// Get stage and group of steps by default
Stage := Process.Stages.Item(0);
// Create a new group of steps, a step for the group and insert groups to the first position in stage
StepGroup := New BProcessStepGroup.Create(Process);
Step_ := New BProcessManualTaskStep.Create("Manual action. Preparation stage", Process);
Step_.Description := "Notify all participants about start of work";
StepGroup.Steps.Add(Step_);
// Add a group of steps to stage
Stage.StepGroups.Insert(0, StepGroup);
// Save changes
Process.Save;
End Sub UserProc;
After executing the example a new group of steps and a new step in it are created for the stage. This group will be placed to the first position in the stage.
See also: