Stages: IBProcessStages;
The Stages property determines process stages.
Executing the example requires that the repository contains a process with the PROCESS identifier.
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;
Stages: IBProcessStages;
Stage: IBProcessStage;
i, c: Integer;
Deadline: DateTime;
Begin
Mb := MetabaseClass.Active;
MDesc := Mb.ItemById("PROCESS");
// Get process structure
Process := BProcessCollection.ByKey(MDesc.Key);
// View information by process stages
// Create stage
Stages := Process.Stages;
c := Stages.Count;
For i := 0 To c - 1 Do
Stage := Stages.Item(i);
Debug.WriteLine("Stage: " + Stage.Name + ". Guid: " + Stage.Guid);
Deadline := Stage.MinDeadline(DateTime.Now);
Debug.WriteLine(" Gateway with conditions: " + Stage.AreConditionsActive.ToString
+ ". Number of groups of steps: " + Stage.StepGroups.Count.ToString
+ ". Termination time: " + (Deadline = DateTime.Now ? "Undefined." : Deadline.ToString));
End For;
End Sub UserProc;
After executing the example the development environment console displays information about process stages.
See also: