IBProcessEventGroupCollection.Count

Syntax

Count: Integer;

Description

The Count property returns the number of groups of events in the collection.

Example

Executing the example requires that the repository contains a process with the PROCESS identifier. Event handlers are set up for 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;
    MObj: IMetabaseObjectDescriptor;
    Process: IBProcess;
    EventCollection: IBProcessEventGroupCollection;
    EventGroup: IBProcessEventGroup;
    Event_: IBProcessEvent;
    i1, c1, i2, c2: Integer;
Begin
    Mb := MetabaseClass.Active;
    MObj := Mb.ItemById("PROCESS");
    // Get process structure
    Process := BProcessCollection.ByKey(MObj.Key);
    // Get the collection of groups of process events
    EventCollection := Process.Events;
    c1 := EventCollection.Count;
    For i1 := 0 To c1 - 1 Do
        // Get group of events
        EventGroup := EventCollection.Item(i1);
        c2 := EventGroup.Count;
        Debug.WriteLine("Group of events: " + EventGroup.Name + ". Number of events: " + c2.ToString);
        Debug.Indent;
        For i2 := 0 To c2 - 1 Do
            Event_ := EventGroup.Item(i2);
            Debug.WriteLine("Event: " + Event_.Name + ". Type: " + Event_.EventType.ToString);
        End For;
        Debug.Unindent;
    End For;
End Sub UserProc;

After executing the example the development environment console displays names of available groups of events and events created in them.

See also:

IBProcessEventGroupCollection