IBProcessSteps.Add

Syntax

Add(Step_: IBProcessStep);

Parameters

Step_. The step that should be added to the collection.

Description

The Add method adds the specified step to the end of the collection.

Example

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;
    Duration: IBPDuration;
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, "Manual action", Process);
    Step_.Description := "Notify all participants about start of work";
    Step_.RoleId := Mb.Security.ResolveName("TESTUSER").Sid.AsString;
    // Step execution time
    Duration := Step_.MaxDuration;
    Duration.Type := DurationType.Day;
    Duration.Amount := 2;
    Duration.IsAbsoluteLag := True;
    Duration.AbsoluteLag := TimeSpan.FromHours(21).ToDouble;
    // Add a step to the collection
    Steps.Add(Step_);
    // Save changes
    Process.Save;
End Sub UserProc;

After executing the example a new step is created for process stage. Description, owner, and execution time will be determined for step.

See also:

IBProcessSteps