IBProcessEventGroupCollection.Add

Syntax

Add(_eventGroup: IBProcessEventGroup);

Parameters

_eventGroup. The group of events that should be added to the collection.

Description

The Add method adds the specified group of events to the collection.

Example

Executing the example requires that the repository contains a process with the PROCESS identifier. Two steps are created at the process' first step. The first step has a group of configured events, which occur on deadline disruption.

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;
    Steps: IBProcessSteps;
    Step1, Step2: IBProcessStep;
    EventCollection: IBProcessEventGroupCollection;
    EventGroup: IBProcessEventGroup;
Begin
    Mb := MetabaseClass.Active;
    MObj := Mb.ItemById("PROCESS");
    // Get process structure
    Process := BProcessCollection.EditByKey(MObj.Key);
    Steps := Process.Stages.First.StepGroups.Item(0).Steps;
    Step1 := Steps.Item(0);
    Step2 := Steps.Item(1);
    // Get the collection of groups of events of step
    EventCollection := Step1.Events;
    // Get group of events of the first step
    EventGroup := EventCollection.ItemByType(BProcessEventType.FailDeadline);
    // Add the obtained group of events for the second step
    Step2.Events.Add(EventGroup);
    // Save process
    If Step2.Events.CheckEvents = Null Then
        Process.Save;
        Debug.WriteLine("--- Process saved ---");
    End If;
End Sub UserProc;

After executing the example, the group of events is obtained, which occur on the first step deadline disruption for the process stage. This group will be added for the second step.

See also:

IBProcessEventGroupCollection